int compare(basic_string_view<charT, traits> sv) const noexcept;
Effects: Определяет эффективную длину rlen строк для сравнения как меньшее из значений size() и sv.size(). Затем функция сравнивает две строки, вызывая traits::compare(data(), sv.data(), rlen).
int compare(size_type pos1, size_type n1, basic_string_view<charT, traits> sv) const;
Effects: Эквивалентен:
return basic_string_view<charT, traits>(data(), size()).substr(pos1, n1).compare(sv);
template<class T>
int compare(size_type pos1, size_type n1, const T& t,
size_type pos2, size_type n2 = npos) const;
Effects: Эквивалентен:
basic_string_view<charT, traits> sv = t; return basic_string_view<charT, traits>( data(), size()).substr(pos1, n1).compare(sv.substr(pos2, n2));
Remarks: Эта функция не будет участвовать в разрешении перегрузки , если is_convertible_v<const T&, basic_string_view<charT, traits>> не true и is_convertible_v<const T&, const charT*> является false.
int compare(const basic_string& str) const noexcept;
int compare(size_type pos1, size_type n1, const basic_string& str) const;
int compare(size_type pos1, size_type n1,
const basic_string& str,
size_type pos2, size_type n2 = npos) const;
int compare(const charT* s) const;
int compare(size_type pos, size_type n1, const charT* s) const;
int compare(size_type pos, size_type n1, const charT* s, size_type n2) const;