std::regex_iterator::operator==,operator!= - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::regex_iterator::operator==,operator!=

From cppreference.com
< cpp‎ | regex‎ | regex iterator

bool operator==(const regex_iterator& rhs) const; | (1) | (since C++11)
bool operator!=(const regex_iterator& rhs) const; | (2) | (since C++11)

Compares two `regex_iterator`s.

For the sake of exposition, assume that `regex_iterator` contains the following members:

- `BidirIt begin`;
- `BidirIt end`;
- const regex_type *pregex;
- std::regex_constants::match_flag_type flags;
- std::match_results<BidirIt> match;

1) Returns true if *this and `rhs` are both end-of-sequence iterators, or if all of the following conditions are true:

- begin == rhs.begin
- end == rhs.end
- pregex == rhs.pregex
- flags == rhs.flags
- match[0] == rhs.match[0]

2) Returns !(*this == rhs)

### [edit] Parameters

rhs | - | a `regex_iterator` to compare to

### [edit] Example

| This section is incomplete Reason: no example

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/regex/regex_iterator/operator_cmp&oldid=63946"
Category:

- Todo no example