Skip to content

Commit cc67e97

Browse files
authored
fix build with gcc 4.9 as the first version of find() can't be constexpr then (#54, thanks @DerDakon)
The build error is: string_view.hpp:859:5: error: body of constexpr function 'constexpr nonstd::sv_lite::basic_string_view<CharT, Traits>::size_type nonstd::sv_lite::basic_string_view<CharT, Traits>::find(nonstd::sv_lite::basic_string_view<CharT, Traits>, nonstd::sv_lite::basic_string_view<CharT, Traits>::size_type) const [with CharT = char; Traits = std::char_traits<char>; nonstd::sv_lite::basic_string_view<CharT, Traits>::size_type = unsigned int]' not a return-statement
1 parent ba99568 commit cc67e97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/nonstd/string_view.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ class basic_string_view
845845

846846
// find(), 4x:
847847

848-
nssv_constexpr size_type find( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1)
848+
nssv_constexpr14 size_type find( basic_string_view v, size_type pos = 0 ) const nssv_noexcept // (1)
849849
{
850850
return assert( v.size() == 0 || v.data() != nssv_nullptr )
851851
, pos >= size()

0 commit comments

Comments
 (0)