Spec-Zone.ru › C++

std::regex_iterator<BidirIt,CharT,Traits>::operator==,operator!=

bool operator==( const regex_iterator& rhs ) const;
(1) (начиная с C++11)
bool operator!=( const regex_iterator& rhs ) const;
(2) (начиная с C++11)
(до C++20)

Сравнивает два объекта regex_iterator.

Оператор != синтезируется на основе operator==.

(начиная с C++20)

Параметры

rhs - объект regex_iterator, с которым выполняется сравнение

Возвращаемое значение

Для пояснения предположим, что regex_iterator содержит следующие члены:

  • BidirIt begin;
  • BidirIt end;
  • const regex_type *pregex;
  • std::regex_constants::match_flag_type flags;
  • std::match_results<BidirIt> match;
1) Возвращает true, если *this и rhs являются итераторами конца последовательности либо если выполняются все следующие условия:
  • begin == rhs.begin
  • end == rhs.end
  • pregex == rhs.pregex
  • flags == rhs.flags
  • match[0] == rhs.match[0]
2) Возвращает !(*this == rhs).

Пример

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/regex/regex_iterator/operator_cmp

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API