operator==,!=,<,<=,>,>=,<=>(std::basic_string)
Definido en el archivo de encabezado <string>
|
||
Compara dos objetos basic_string |
||
(1) | ||
template< class CharT, class Traits, class Alloc > bool operator==( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(hasta C++11) | |
template< class CharT, class Traits, class Alloc > bool operator==( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(desde C++11) (hasta C++20) |
|
template< class CharT, class Traits, class Alloc > constexpr bool |
(desde C++20) | |
(2) | ||
template< class CharT, class Traits, class Alloc > bool operator!=( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(hasta C++11) | |
template< class CharT, class Traits, class Alloc > bool operator!=( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(desde C++11) (hasta C++20) |
|
(3) | ||
template< class CharT, class Traits, class Alloc > bool operator<( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(hasta C++11) | |
template< class CharT, class Traits, class Alloc > bool operator<( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(desde C++11) (hasta C++20) |
|
(4) | ||
template< class CharT, class Traits, class Alloc > bool operator<=( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(hasta C++11) | |
template< class CharT, class Traits, class Alloc > bool operator<=( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(desde C++11) (hasta C++20) |
|
(5) | ||
template< class CharT, class Traits, class Alloc > bool operator>( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(hasta C++11) | |
template< class CharT, class Traits, class Alloc > bool operator>( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(desde C++11) (hasta C++20) |
|
(6) | ||
template< class CharT, class Traits, class Alloc > bool operator>=( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(hasta C++14) | |
template< class CharT, class Traits, class Alloc > bool operator>=( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(desde C++14) (hasta C++20) |
|
template< class CharT, class Traits, class Alloc > constexpr /*comp-cat*/ |
(7) | (desde C++20) |
Compara un objeto basic_string y un array de T terminado en nulo |
||
(8) | ||
template< class CharT, class Traits, class Alloc > bool operator==( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(hasta C++20) | |
template< class CharT, class Traits, class Alloc > constexpr bool operator==( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(desde C++20) | |
template< class CharT, class Traits, class Alloc > bool operator==( const CharT* lhs, |
(hasta C++20) | |
(9) | ||
template< class CharT, class Traits, class Alloc > bool operator!=( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(hasta C++20) | |
template< class CharT, class Traits, class Alloc > bool operator!=( const CharT* lhs, |
(hasta C++20) | |
(10) | ||
template< class CharT, class Traits, class Alloc > bool operator<( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(hasta C++20) | |
template< class CharT, class Traits, class Alloc > bool operator<( const CharT* lhs, |
(hasta C++20) | |
(11) | ||
template< class CharT, class Traits, class Alloc > bool operator<=( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(hasta C++20) | |
template< class CharT, class Traits, class Alloc > bool operator<=( const CharT* lhs, |
(hasta C++20) | |
(12) | ||
template< class CharT, class Traits, class Alloc > bool operator>( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(hasta C++20) | |
template< class CharT, class Traits, class Alloc > bool operator>( const CharT* lhs, |
(hasta C++20) | |
(13) | ||
template< class CharT, class Traits, class Alloc > bool operator>=( const std::basic_string<CharT,Traits,Alloc>& lhs, |
(hasta C++20) | |
template< class CharT, class Traits, class Alloc > bool operator>=( const CharT* lhs, |
(hasta C++20) | |
template< class CharT, class Traits, class Alloc > constexpr /*comp-cat*/ |
(14) | (desde C++20) |
Compara el contenido de una cadena con otra cadena o un array de CharT
terminado en nulo.
Todas las comparaciones se hacen mediante la función miembro compare() (que en sí misma se define en términos de Traits::compare()
):
- Dos cadenas son iguales si tanto el tamaño de
lhs
yrhs
son iguales y cada carácter enlhs
tiene un carácter equivalente enrhs
en la misma posición.
- El orden de las comparaciones se hace lexicográficamente--la comparación se realiza por una función equivalente a