|
|
| regex_iterator ()=default |
| | Constructs the end sentinel.
|
| |
| | regex_iterator (BidirIt first, BidirIt last, const regex_type &re, regex_constants::match_flag_type flags=regex_constants::match_default) |
| | Constructs a begin iterator over [first, last) and finds the first match. A constraining match flag (see detail::real_honors) routes to the std backend, which carries the flags through the wrapped std::regex_iterator.
|
| |
| | regex_iterator (const regex_iterator &other) |
| | Copies the iteration position, but NOT the walker.
|
| |
| regex_iterator & | operator= (const regex_iterator &other) |
| | Copy-assigns the iteration position, dropping any walker this iterator owned.
|
| |
|
| regex_iterator (regex_iterator &&) noexcept=default |
| | Moves the walker along with the position.
|
| |
| regex_iterator & | operator= (regex_iterator &&) noexcept=default |
| | Move-assigns, carrying the walker along with the position.
|
| |
|
| ~regex_iterator ()=default |
| | Releases the walker, if any.
|
| |
|
| regex_iterator (BidirIt first, BidirIt last, const regex_type &&re, regex_constants::match_flag_type flags=regex_constants::match_default)=delete |
| | Constructing from a temporary regex would dangle (std::regex_iterator parity).
|
| |
| reference | operator* () const |
| | The current match.
|
| |
| pointer | operator-> () const |
| | The current match.
|
| |
| regex_iterator & | operator++ () |
| | Advances to the next match, becoming the end sentinel when there is none.
|
| |
| regex_iterator | operator++ (int) |
| | Advances to the next match, returning the previous position.
|
| |
| bool | operator== (const regex_iterator &other) const |
| | Equality. Two non-end iterators compare equal only for the same regex, sequence, flags and current match — not for a coincidental same position across different patterns.
|
| |
| bool | operator!= (const regex_iterator &other) const |
| | Inequality, the negation of operator==.
|
| |
|
|
std::unique_ptr< walker_type > | walker_ |
| | Owned, never copied – see the copy constructor.
|
| |
|
BidirIt | begin_ {} |
| | Start of the sequence.
|
| |
|
BidirIt | end_ {} |
| | End of the sequence.
|
| |
|
const regex_type * | re_ {nullptr} |
| | The pattern, borrowed.
|
| |
|
regex_constants::match_flag_type | flags_ {regex_constants::match_default} |
| | Match flags this iteration was built with.
|
| |
|
bool | real_path_ {false} |
| | Whether the REAL engine drives the traversal rather than the std backend.
|
| |
|
std::size_t | real_pos_ {} |
| | REAL path: byte offset the next region search starts at.
|
| |
|
std::optional< std::regex_iterator< BidirIt > > | std_it_ |
| | std path: the wrapped iterator (engaged only off the REAL path).
|
| |
|
value_type | match_ |
| | The current match, refilled by each increment.
|
| |
|
bool | at_end_ {true} |
| | Whether this is the end sentinel.
|
| |
template<typename BidirIt, typename CharT = typename std::iterator_traits<BidirIt>::value_type, typename Traits = std::regex_traits<CharT>>
class real::compat::regex_iterator< BidirIt, CharT, Traits >
Iterates the non-overlapping matches of a pattern in a sequence (std::regex_iterator).
Same per-operation routing as regex_replace — a real-backed, non-nullable pattern drives real's linear traversal (repeated region search — a non-nullable pattern never matches empty, so the position always advances past the match and the ECMAScript and real sequences agree); the std backend and nullable patterns wrap std::regex_iterator (whose empty-match advance is ECMAScript's). The default-constructed iterator is the end sentinel.
- Template Parameters
-
| BidirIt | A contiguous iterator into the searched sequence. |
template<typename BidirIt , typename CharT = typename std::iterator_traits<BidirIt>::value_type, typename Traits = std::regex_traits<CharT>>
Copies the iteration position, but NOT the walker.
The walker is an accelerator over real_pos_, never the state itself, and that is what makes this cheap where the obvious designs are not. Copying it would clone the VM scratch it embeds; sharing it copy-on-write would clone on the first advance, which operator++(int) performs on every call – buying ++it at the price of it++. Leaving the copy without one costs it a single walker construction IF it ever advances, and nothing at all if it does not, which is what a post-increment's discarded result actually does.
- Parameters
-
| [in] | other | The iterator to copy. |