operator==,!=,<,<=,>,>=,<=>(std::basic_string_view)
From cppreference.com
< cpp | string | basic string view
Defined in header <string_view>
|
||
(1) | ||
template< class CharT, class Traits > constexpr bool operator==( std::basic_string_view<CharT,Traits> lhs, |
(since C++17) (until C++20) |
|
template< class CharT, class Traits > constexpr bool operator==( |
(since C++20) | |
template< class CharT, class Traits > constexpr bool operator!=( std::basic_string_view<CharT,Traits> lhs, |
(2) | (since C++17) (until C++20) |
template< class CharT, class Traits > constexpr bool operator<( std::basic_string_view<CharT,Traits> lhs, |
(3) | (since C++17) (until C++20) |
template< class CharT, class Traits > constexpr bool operator<=( std::basic_string_view<CharT,Traits> lhs, |
(4) | (since C++17) (until C++20) |
template< class CharT, class Traits > constexpr bool operator>( std::basic_string_view<CharT,Traits> lhs, |
(5) | (since C++17) (until C++20) |
template< class CharT, class Traits > constexpr bool operator>=( std::basic_string_view<CharT,Traits> lhs, |
(6) | (since C++17) (until C++20) |
template< class CharT, class Traits > constexpr /*comp-cat*/ operator<=>( |
(7) | (since C++20) |
Compares two views.
All comparisons are done via the compare() member function (which itself is defined in terms of Traits::compare()
):
- Two views are equal if both the size of lhs and rhs are equal and each character in lhs has an equivalent character in rhs at the same position.
- The ordering comparisons are done lexicographically – the comparison is performed by a function equivalent to