diff --git a/src/engine/strview.h b/src/engine/strview.h index b4d9003124..07e8ee16c4 100644 --- a/src/engine/strview.h +++ b/src/engine/strview.h @@ -49,7 +49,7 @@ template<> struct sv_to_uchar # pragma GCC diagnostic ignored "-Wtype-limits" #endif -template constexpr std::size_t find_first_of( Ch const* p_, std::size_t n_, Ch const* s, std::size_t pos, std::size_t n ) noexcept +template std::size_t find_first_of( Ch const* p_, std::size_t n_, Ch const* s, std::size_t pos, std::size_t n ) noexcept { typedef typename sv_to_uchar::type UCh; @@ -104,7 +104,7 @@ template constexpr std::size_t find_first_of( Ch const* p_, std::size_ return static_cast( -1 ); } -template constexpr std::size_t find_last_of( Ch const* p_, Ch const* s, std::size_t pos, std::size_t n ) noexcept +template std::size_t find_last_of( Ch const* p_, Ch const* s, std::size_t pos, std::size_t n ) noexcept { typedef typename sv_to_uchar::type UCh; @@ -174,7 +174,7 @@ template constexpr std::size_t find_last_of( Ch const* p_, Ch const* s return npos; } -template constexpr std::size_t find_first_not_of( Ch const* p_, std::size_t n_, Ch const* s, std::size_t pos, std::size_t n ) noexcept +template std::size_t find_first_not_of( Ch const* p_, std::size_t n_, Ch const* s, std::size_t pos, std::size_t n ) noexcept { typedef typename sv_to_uchar::type UCh; @@ -237,7 +237,7 @@ template constexpr std::size_t find_first_not_of( Ch const* p_, std::s return static_cast( -1 ); } -template constexpr std::size_t find_last_not_of( Ch const* p_, Ch const* s, std::size_t pos, std::size_t n ) noexcept +template std::size_t find_last_not_of( Ch const* p_, Ch const* s, std::size_t pos, std::size_t n ) noexcept { typedef typename sv_to_uchar::type UCh; @@ -451,13 +451,13 @@ template class basic_string_view // element access - constexpr const_reference operator[]( size_type pos ) const noexcept + const_reference operator[]( size_type pos ) const noexcept { assert( pos < size() ); return p_[ pos ]; } - constexpr const_reference at( size_type pos ) const + const_reference at( size_type pos ) const { if( pos >= size() ) { @@ -467,13 +467,13 @@ template class basic_string_view return p_[ pos ]; } - constexpr const_reference front() const noexcept + const_reference front() const noexcept { assert( !empty() ); return p_[ 0 ]; } - constexpr const_reference back() const noexcept + const_reference back() const noexcept { assert( !empty() ); return p_[ n_ - 1 ]; @@ -486,7 +486,7 @@ template class basic_string_view // modifiers - constexpr void remove_prefix( size_type n ) noexcept + void remove_prefix( size_type n ) noexcept { assert( n <= size() ); @@ -494,14 +494,14 @@ template class basic_string_view n_ -= n; } - constexpr void remove_suffix( size_type n ) noexcept + void remove_suffix( size_type n ) noexcept { assert( n <= size() ); n_ -= n; } - constexpr void swap( basic_string_view& s ) noexcept + void swap( basic_string_view& s ) noexcept { std::swap( p_, s.p_ ); std::swap( n_, s.n_ ); @@ -509,7 +509,7 @@ template class basic_string_view // string operations - constexpr size_type copy( Ch* s, size_type n, size_type pos = 0 ) const + size_type copy( Ch* s, size_type n, size_type pos = 0 ) const { if( pos > size() ) { @@ -523,7 +523,7 @@ template class basic_string_view return rlen; } - constexpr basic_string_view substr( size_type pos = 0, size_type n = npos ) const + basic_string_view substr( size_type pos = 0, size_type n = npos ) const { if( pos > size() ) { @@ -537,7 +537,7 @@ template class basic_string_view // compare - constexpr int compare( basic_string_view str ) const noexcept + int compare( basic_string_view str ) const noexcept { std::size_t rlen = (std::min)( size(), str.size() ); @@ -616,7 +616,7 @@ template class basic_string_view return find( str.data(), pos, str.size() ); } - constexpr size_type find( Ch c, size_type pos = 0 ) const noexcept + size_type find( Ch c, size_type pos = 0 ) const noexcept { if( pos >= size() ) return npos; @@ -625,7 +625,7 @@ template class basic_string_view return r? r - data(): npos; } - constexpr size_type find( Ch const* s, size_type pos, size_type n ) const noexcept + size_type find( Ch const* s, size_type pos, size_type n ) const noexcept { if( n == 1 ) return find( s[0], pos ); @@ -661,7 +661,7 @@ template class basic_string_view return rfind( str.data(), pos, str.size() ); } - constexpr size_type rfind( Ch c, size_type pos = npos ) const noexcept + size_type rfind( Ch c, size_type pos = npos ) const noexcept { size_type n = size(); @@ -685,7 +685,7 @@ template class basic_string_view return npos; } - constexpr size_type rfind( Ch const* s, size_type pos, size_type n ) const noexcept + size_type rfind( Ch const* s, size_type pos, size_type n ) const noexcept { if( n > size() ) return npos; @@ -727,7 +727,7 @@ template class basic_string_view return find( c, pos ); } - constexpr size_type find_first_of( Ch const* s, size_type pos, size_type n ) const noexcept + size_type find_first_of( Ch const* s, size_type pos, size_type n ) const noexcept { if( n == 0 || pos >= size() ) return npos; if( n == 1 ) return find( s[0], pos ); @@ -752,7 +752,7 @@ template class basic_string_view return rfind( c, pos ); } - constexpr size_type find_last_of( Ch const* s, size_type pos, size_type n ) const noexcept + size_type find_last_of( Ch const* s, size_type pos, size_type n ) const noexcept { if( n == 1 ) { @@ -786,7 +786,7 @@ template class basic_string_view return find_first_not_of( str.data(), pos, str.size() ); } - constexpr size_type find_first_not_of( Ch c, size_type pos = 0 ) const noexcept + size_type find_first_not_of( Ch c, size_type pos = 0 ) const noexcept { for( std::size_t i = pos; i < n_; ++i ) { @@ -796,7 +796,7 @@ template class basic_string_view return npos; } - constexpr size_type find_first_not_of( Ch const* s, size_type pos, size_type n ) const noexcept + size_type find_first_not_of( Ch const* s, size_type pos, size_type n ) const noexcept { if( pos >= size() ) return npos; if( n == 1 ) return find_first_not_of( s[0], pos ); @@ -816,7 +816,7 @@ template class basic_string_view return find_last_not_of( str.data(), pos, str.size() ); } - constexpr size_type find_last_not_of( Ch c, size_type pos = npos ) const noexcept + size_type find_last_not_of( Ch c, size_type pos = npos ) const noexcept { size_type m = size(); @@ -840,7 +840,7 @@ template class basic_string_view return npos; } - constexpr size_type find_last_not_of( Ch const* s, size_type pos, size_type n ) const noexcept + size_type find_last_not_of( Ch const* s, size_type pos, size_type n ) const noexcept { if( n == 1 ) { @@ -874,7 +874,7 @@ template class basic_string_view return find( sv ) != npos; } - constexpr bool contains( Ch c ) const noexcept + bool contains( Ch c ) const noexcept { Ch const* p = data(); size_type n = size();