Files
2025-10-25 03:02:53 +03:00

2.2 KiB
Raw Permalink Blame History

[string.view.comparison]

27 Strings library [strings]

27.3 String view classes [string.view]

27.3.4 Non-member comparison functions [string.view.comparison]

🔗

template<class charT, class traits> constexpr bool operator==(basic_string_view<charT, traits> lhs, type_identity_t<basic_string_view<charT, traits>> rhs) noexcept;

1

#

Returns: lhs.compare(rhs) == 0.

🔗

template<class charT, class traits> constexpr see below operator<=>(basic_string_view<charT, traits> lhs, type_identity_t<basic_string_view<charT, traits>> rhs) noexcept;

2

#

Let R denote the type traits::comparison_category if that qualified-id is valid and denotes a type ([temp.deduct]), otherwise R is weak_ordering.

3

#

Mandates: R denotes a comparison category type ([cmp.categories]).

4

#

Returns: static_cast(lhs.compare(rhs) <=> 0).

5

#

[Note 1:

The usage of type_identity_t as parameter ensures that an object of type basic_string_view<charT, traits> can always be compared with an object of a type T with an implicit conversion to basic_string_view<charT, traits>, and vice versa, as per [over.match.oper].

— end note]