libstdc++
GNU C++ library
Loading...
Searching...
No Matches

◆ operator==()

template<typename _Bi_iter, typename _Alloc>
bool operator== ( const match_results< _Bi_iter, _Alloc > & __m1,
const match_results< _Bi_iter, _Alloc > & __m2 )
related

Compares two match_results for equality.

Returns
true if the two objects refer to the same match, false otherwise.

Definition at line 2208 of file regex.h.

2210 {
2211 if (__m1.ready() != __m2.ready())
2212 return false;
2213 if (!__m1.ready()) // both are not ready
2214 return true;
2215 if (__m1.empty() != __m2.empty())
2216 return false;
2217 if (__m1.empty()) // both are empty
2218 return true;
2219 return __m1.prefix() == __m2.prefix()
2220 && __m1.size() == __m2.size()
2221 && std::equal(__m1.begin(), __m1.end(), __m2.begin())
2222 && __m1.suffix() == __m2.suffix();
2223 }
constexpr bool equal(_IIter1, _IIter1, _IIter2)
size_type size() const noexcept
Gets the number of matches and submatches.
Definition regex.h:1896
const_reference prefix() const
Gets a sub_match representing the match prefix.
Definition regex.h:1988
const_iterator end() const noexcept
Gets an iterator to one-past-the-end of the collection.
Definition regex.h:2027
const_reference suffix() const
Gets a sub_match representing the match suffix.
Definition regex.h:2003
bool ready() const noexcept
Indicates if the match_results is ready.
Definition regex.h:1879
bool empty() const noexcept
Indicates if the match_results contains no results.
Definition regex.h:1909
const_iterator begin() const noexcept
Gets an iterator to the start of the sub_match collection.
Definition regex.h:2013
The results of a match or search operation.
Definition regex.h:1772