Skip to content

Commit 169d7fa

Browse files
authored
Fix string_view::cend() recursively calling self (#27)
`string_view::cend()` was defined as calling `cend()` unqualified, resulting in an infinite recursive loop (and inevitable crashes as a result). The fix here is simple: just define the logic inline, and don't call `cend()`. Runners on CI are failing due to being very old/deprecated. Fixes: #26
1 parent 4f33a7f commit 169d7fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/bpstd/string_view.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ typename bpstd::basic_string_view<CharT,Traits>::const_iterator
11861186
bpstd::basic_string_view<CharT,Traits>::cend()
11871187
const noexcept
11881188
{
1189-
return cend();
1189+
return m_str + m_size;
11901190
}
11911191

11921192
template <typename CharT, typename Traits>

0 commit comments

Comments
 (0)