[string.cmp]

# 27 Strings library [[strings]](./#strings)

## 27.4 String classes [[string.classes]](string.classes#string.cmp)

### 27.4.4 Non-member functions [[string.nonmembers]](string.nonmembers#string.cmp)

#### 27.4.4.2 Non-member comparison operator functions [string.cmp]

[ð](#itemdecl:1)

`template<class charT, class traits, class Allocator>
  constexpr bool
    operator==(const basic_string<charT, traits, Allocator>& lhs,
               const basic_string<charT, traits, Allocator>& rhs) noexcept;
template<class charT, class traits, class Allocator>
  constexpr bool operator==(const basic_string<charT, traits, Allocator>& lhs,
                            const charT* rhs);

template<class charT, class traits, class Allocator>
  constexpr see below operator<=>(const basic_string<charT, traits, Allocator>& lhs,
                                  const basic_string<charT, traits, Allocator>& rhs) noexcept;
template<class charT, class traits, class Allocator>
  constexpr see below operator<=>(const basic_string<charT, traits, Allocator>& lhs,
                                  const charT* rhs);
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/strings.tex#L4980)

*Effects*: Let *op* be the operator[.](#1.sentence-1)

Equivalent to:return basic_string_view<charT, traits>(lhs) *op* basic_string_view<charT, traits>(rhs);
