operator==,!=,<,<=,>,>=,<=>(std::sub_match)_C++中文网
bool operator==( const std::sub_match<BidirIt>& lhs,
const std::sub_match<BidirIt>& rhs );
template< class BidirIt >
bool operator!=( const std::sub_match<BidirIt>& lhs,
(C++20 前)
template< class BidirIt >
bool operator<( const std::sub_match<BidirIt>& lhs,
(C++20 前)
template< class BidirIt >
bool operator<=( const std::sub_match<BidirIt>& lhs,
(C++20 前)
template< class BidirIt >
bool operator>( const std::sub_match<BidirIt>& lhs,
(C++20 前)
template< class BidirIt >
bool operator>=( const std::sub_match<BidirIt>& lhs,
(C++20 前)
template< class BidirIt >
/*comp-cat*/ operator<=>( const std::sub_match<BidirIt>& lhs,
std::sub_match 与 std::basic_string
(C++20 前) (10) (C++11 起)
(C++20 前) (11) (C++11 起)
(C++20 前) (12) (C++11 起)
(C++20 前) (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,
std::basic_string 与 std::sub_match
(C++20 前) (16) (C++11 起)
(C++20 前) (17) (C++11 起)
(C++20 前) (18) (C++11 起)
(C++20 前) (19) (C++11 起)
(C++20 前) (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,
template< class BidirIt >
bool operator!=( const std::sub_match<BidirIt>& sm,
(C++20 前)
template< class BidirIt >
bool operator<( const std::sub_match<BidirIt>& sm,
(C++20 前)
template< class BidirIt >
bool operator<=( const std::sub_match<BidirIt>& sm,
(C++20 前)
template< class BidirIt >
bool operator>( const std::sub_match<BidirIt>& sm,
(C++20 前)
template< class BidirIt >
bool operator>=( const std::sub_match<BidirIt>& sm,
(C++20 前)
template< class BidirIt >
/*comp-cat*/ operator<=>( const std::sub_match<BidirIt>& sm,
std::iterator_traits<BidirIt>::value_type* 与 std::sub_match
template< class BidirIt >
bool operator==( const typename std::iterator_traits<BidirIt>::value_type* s,
(C++20 前)
template< class BidirIt >
bool operator!=( const typename std::iterator_traits<BidirIt>::value_type* s,
(C++20 前)
template< class BidirIt >
bool operator<( const typename std::iterator_traits<BidirIt>::value_type* s,
(C++20 前)
template< class BidirIt >
bool operator<=( const typename std::iterator_traits<BidirIt>::value_type* s,
(C++20 前)
template< class BidirIt >
bool operator>( const typename std::iterator_traits<BidirIt>::value_type* s,
(C++20 前)
template< class BidirIt >
bool operator>=( const typename std::iterator_traits<BidirIt>::value_type* s,
(C++20 前)
std::sub_match 与 std::iterator_traits<BidirIt>::value_type
template< class BidirIt >
bool operator==( const std::sub_match<BidirIt>& sm,
template< class BidirIt >
bool operator!=( const std::sub_match<BidirIt>& sm,
(C++20 前)
template< class BidirIt >
bool operator<( const std::sub_match<BidirIt>& sm,
(C++20 前)
template< class BidirIt >
bool operator<=( const std::sub_match<BidirIt>& sm,
(C++20 前)
template< class BidirIt >
bool operator>( const std::sub_match<BidirIt>& sm,
(C++20 前)
template< class BidirIt >
bool operator>=( const std::sub_match<BidirIt>& sm,
(C++20 前)
template< class BidirIt >
/*comp-cat*/ operator<=>( const std::sub_match<BidirIt>& sm,
std::iterator_traits<BidirIt>::value_type 与 std::sub_match
template< class BidirIt >
bool operator==( const typename std::iterator_traits<BidirIt>::value_type& ch,
(C++20 前)
template< class BidirIt >
bool operator!=( const typename std::iterator_traits<BidirIt>::value_type& ch,
(C++20 前)
template< class BidirIt >
bool operator<( const typename std::iterator_traits<BidirIt>::value_type& ch,
(C++20 前)
template< class BidirIt >
bool operator<=( const typename std::iterator_traits<BidirIt>::value_type& ch,
(C++20 前)
template< class BidirIt >
bool operator>( const typename std::iterator_traits<BidirIt>::value_type& ch,
(C++20 前)
template< class BidirIt >
bool operator>=( const typename std::iterator_traits<BidirIt>::value_type& ch,
(C++20 前)
比较 sub_match 与另一 sub_match 、 string 、空终止字符序列或字符。
1-7) 通过直接比较其底层序列比较二个 sub_match 。如同以 lhs.compare(rhs) 实现。
8-20) 比较 sub_match 与 std::basic_string 。如同以 sm.compare(typename sub_match<BidirIt>::string_type(st.data(), st.size()) 实现。
21-33) 比较 sub_match 与空终止字符串。如同以 sm.compare(s) 实现。
34-46) 比较 sub_match 与字符。如同以 sm.compare(typename sub_match<BidirIt>::string_type(1, ch)) 实现。
|
三路比较运算符的结果类型( /*comp-cat*/ )是 std::compare_three_way_result_t<typename std::sub_match<BidirIt>::string_type>> ,即 typename std::char_traits<typename std::iterator_traits<BidirIt>::value_type>::comparison_category 若它存在,否则为 std::weak_ordering 。 |
(C++20 起) |
参数
| lhs, rhs, sm | - | 要比较的 sub_match
|
| st | - | 要比较的 basic_string
|
| s | - | 指向要比较空终止字符串的指针 |
| ch | - | 要比较的字符 |
返回值
对于 operator== , (C++20 起)若以 std::sub_match::compare() 定义的对应关系成立则为 true ,否则为 false 。
注解
|
若 |
(C++20 起) |