operator==,!=,<,<=,>,>=, <=> (std::sub_match)
Определено в заголовке <regex> | ||
|---|---|---|
| Прямое сравнение | ||
template< class BidirIt >
bool operator==( const std::sub_match<BidirIt>& lhs,
const std::sub_match<BidirIt>& rhs );
| (1) | (с C++11) |
template< class BidirIt >
bool operator!=( const std::sub_match<BidirIt>& lhs,
const std::sub_match<BidirIt>& rhs );
| (2) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator<( const std::sub_match<BidirIt>& lhs,
const std::sub_match<BidirIt>& rhs );
| (3) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator<=( const std::sub_match<BidirIt>& lhs,
const std::sub_match<BidirIt>& rhs );
| (4) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator>( const std::sub_match<BidirIt>& lhs,
const std::sub_match<BidirIt>& rhs );
| (5) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator>=( const std::sub_match<BidirIt>& lhs,
const std::sub_match<BidirIt>& rhs );
| (6) | (с C++11) (до C++20) |
template< class BidirIt >
/*comp-cat*/ operator<=>( const std::sub_match<BidirIt>& lhs,
const std::sub_match<BidirIt>& rhs );
| (7) | (с C++20) |
std::sub_match и std::basic_string
| ||
template< class BidirIt, class Traits, class Alloc >
bool operator==( const std::sub_match<BidirIt>& sm,
const std::basic_string<
typename std::iterator_traits<BidirIt>::value_type,
Traits,Alloc>& rhs );
| (8) | (с C++11) |
template< class BidirIt, class Traits, class Alloc >
bool operator!=( const std::sub_match<BidirIt>& sm,
const std::basic_string<
typename std::iterator_traits<BidirIt>::value_type,
Traits,Alloc>& st );
| (9) | (с C++11) (до C++20) |
template< class BidirIt, class Traits, class Alloc >
bool operator<( const std::sub_match<BidirIt>& sm,
const std::basic_string<
typename std::iterator_traits<BidirIt>::value_type,
Traits,Alloc>& st );
| (10) | (с C++11) (до C++20) |
template< class BidirIt, class Traits, class Alloc >
bool operator<=( const std::sub_match<BidirIt>& sm,
const std::basic_string<
typename std::iterator_traits<BidirIt>::value_type,
Traits,Alloc>& st );
| (11) | (с C++11) (до C++20) |
template< class BidirIt, class Traits, class Alloc >
bool operator>( const std::sub_match<BidirIt>& sm,
const std::basic_string<
typename std::iterator_traits<BidirIt>::value_type,
Traits,Alloc>& st );
| (12) | (с C++11) (до C++20) |
template< class BidirIt, class Traits, class Alloc >
bool operator>=( const std::sub_match<BidirIt>& sm,
const std::basic_string<
typename std::iterator_traits<BidirIt>::value_type,
Traits,Alloc>& st );
| (13) | (с C++11) (до C++20) |
template< class BidirIt, class Traits, class Alloc >
/*comp-cat*/ operator<=>( const std::sub_match<BidirIt>& sm,
const std::basic_string<
typename std::iterator_traits<BidirIt>::value_type,
Traits,Alloc>& st );
| (14) | (с C++20) |
std::basic_string и std::sub_match
| ||
template< class BidirIt, class Traits, class Alloc >
bool operator==( const std::basic_string<
typename std::iterator_traits<BidirIt>::value_type,
Traits,Alloc>& st,
const std::sub_match<BidirIt>& sm );
| (15) | (с C++11) (до C++20) |
template< class BidirIt, class Traits, class Alloc >
bool operator!=( const std::basic_string<
typename std::iterator_traits<BidirIt>::value_type,
Traits,Alloc>& st,
const std::sub_match<BidirIt>& sm );
| (16) | (с C++11) (до C++20) |
template< class BidirIt, class Traits, class Alloc >
bool operator<( const std::basic_string<
typename std::iterator_traits<BidirIt>::value_type,
Traits,Alloc>& st,
const std::sub_match<BidirIt>& sm );
| (17) | (с C++11) (до C++20) |
template< class BidirIt, class Traits, class Alloc >
bool operator<=( const std::basic_string<
typename std::iterator_traits<BidirIt>::value_type,
Traits,Alloc>& st,
const std::sub_match<BidirIt>& sm );
| (18) | (с C++11) (до C++20) |
template< class BidirIt, class Traits, class Alloc >
bool operator>( const std::basic_string<
typename std::iterator_traits<BidirIt>::value_type,
Traits,Alloc>& st,
const std::sub_match<BidirIt>& sm );
| (19) | (с C++11) (до C++20) |
template< class BidirIt, class Traits, class Alloc >
bool operator>=( const std::basic_string<
typename std::iterator_traits<BidirIt>::value_type,
Traits,Alloc>& st,
const std::sub_match<BidirIt>& sm );
| (20) | (с C++11) (до C++20) |
std::sub_match и std::iterator_traits<BidirIt>::value_type*
| ||
template< class BidirIt >
bool operator==( const std::sub_match<BidirIt>& sm,
const typename std::iterator_traits<BidirIt>::value_type* s );
| (21) | (с C++11) |
template< class BidirIt >
bool operator!=( const std::sub_match<BidirIt>& sm,
const typename std::iterator_traits<BidirIt>::value_type* s );
| (22) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator<( const std::sub_match<BidirIt>& sm,
const typename std::iterator_traits<BidirIt>::value_type* s );
| (23) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator<=( const std::sub_match<BidirIt>& sm,
const typename std::iterator_traits<BidirIt>::value_type* s );
| (24) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator>( const std::sub_match<BidirIt>& sm,
const typename std::iterator_traits<BidirIt>::value_type* s );
| (25) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator>=( const std::sub_match<BidirIt>& sm,
const typename std::iterator_traits<BidirIt>::value_type* s );
| (26) | (с C++11) (до C++20) |
template< class BidirIt >
/*comp-cat*/ operator<=>( const std::sub_match<BidirIt>& sm,
const typename std::iterator_traits<BidirIt>::value_type* s );
| (27) | (с C++20) |
std::iterator_traits<BidirIt>::value_type* и std::sub_match
| ||
template< class BidirIt >
bool operator==( const typename std::iterator_traits<BidirIt>::value_type* s,
const std::sub_match<BidirIt>& sm );
| (28) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator!=( const typename std::iterator_traits<BidirIt>::value_type* s,
const std::sub_match<BidirIt>& sm );
| (29) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator<( const typename std::iterator_traits<BidirIt>::value_type* s,
const std::sub_match<BidirIt>& sm );
| (30) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator<=( const typename std::iterator_traits<BidirIt>::value_type* s,
const std::sub_match<BidirIt>& sm );
| (31) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator>( const typename std::iterator_traits<BidirIt>::value_type* s,
const std::sub_match<BidirIt>& sm );
| (32) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator>=( const typename std::iterator_traits<BidirIt>::value_type* s,
const std::sub_match<BidirIt>& sm );
| (33) | (с C++11) (до C++20) |
std::sub_match и std::iterator_traits<BidirIt>::value_type
| ||
template< class BidirIt >
bool operator==( const std::sub_match<BidirIt>& sm,
const typename std::iterator_traits<BidirIt>::value_type& ch );
| (34) | (с C++11) |
template< class BidirIt >
bool operator!=( const std::sub_match<BidirIt>& sm,
const typename std::iterator_traits<BidirIt>::value_type& ch );
| (35) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator<( const std::sub_match<BidirIt>& sm,
const typename std::iterator_traits<BidirIt>::value_type& ch );
| (36) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator<=( const std::sub_match<BidirIt>& sm,
const typename std::iterator_traits<BidirIt>::value_type& ch );
| (37) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator>( const std::sub_match<BidirIt>& sm,
const typename std::iterator_traits<BidirIt>::value_type& ch );
| (38) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator>=( const std::sub_match<BidirIt>& sm,
const typename std::iterator_traits<BidirIt>::value_type& ch );
| (39) | (с C++11) (до C++20) |
template< class BidirIt >
/*comp-cat*/ operator<=>( const std::sub_match<BidirIt>& sm,
const typename std::iterator_traits<BidirIt>::value_type& ch );
| (40) | (с C++20) |
std::iterator_traits<BidirIt>::value_type и std::sub_match
| ||
template< class BidirIt >
bool operator==( const typename std::iterator_traits<BidirIt>::value_type& ch,
const std::sub_match<BidirIt>& sm );
| (41) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator!=( const typename std::iterator_traits<BidirIt>::value_type& ch,
const std::sub_match<BidirIt>& sm );
| (42) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator<( const typename std::iterator_traits<BidirIt>::value_type& ch,
const std::sub_match<BidirIt>& sm );
| (43) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator<=( const typename std::iterator_traits<BidirIt>::value_type& ch,
const std::sub_match<BidirIt>& sm );
| (44) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator>( const typename std::iterator_traits<BidirIt>::value_type& ch,
const std::sub_match<BidirIt>& sm );
| (45) | (с C++11) (до C++20) |
template< class BidirIt >
bool operator>=( const typename std::iterator_traits<BidirIt>::value_type& ch,
const std::sub_match<BidirIt>& sm );
| (46) | (с C++11) (до C++20) |
Сравнивает sub_match с другой sub_match, строкой, последовательностью символов с нулевым завершением или символом.
sub_match напрямую, сравнивая их лежащие в основе последовательности символов. Реализовано так, как если бы это делалось через lhs.compare(rhs).sub_match с std::basic_string. Реализовано как если бы это делал sm.compare(typename sub_match<BidirIt>::string_type(st.data(), st.size()).sub_match с строкой с нулевым завершением. Реализовано как если бы это делал sm.compare(s).sub_match с символом. Реализовано как если бы это делал sm.compare(typename sub_match<BidirIt>::string_type(1, ch)).| Тип возвращаемого значения операторов трехстороннего сравнения ( Операторы | (с C++20) |
Параметры
| lhs, rhs, sm | - | сравниваемое sub_match |
| st | - | сравниваемое basic_string |
| s | - | указатель на строку с нулевым завершением для сравнения |
| ch | - | сравниваемый символ |
Значение результата
Для operator==, (с C++20)true если соответствующее сравнение выполняется, как определено в std::sub_match::compare(), false в противном случае.
| Для | (с C++20) |
Примечания
| Если тип значения | (с C++20) |
Пример
Отчеты об ошибках
Следующие отчеты об ошибках, изменяющие поведение, были применены ретроактивно к ранее опубликованным стандартам C++.
| DR | Применимо к | Поведение, как опубликовано | Корректное поведение |
|---|---|---|---|
| LWG 3432 | C++20 | тип возвращаемого значения operator<=> не должен был быть типом категории сравнения | необходимый |
См. также
| сравнивает соответствующие подпоследовательности (если таковые имеются) (публичный член-функция) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/regex/sub_match/operator_cmp