REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
Loading...
Searching...
No Matches
real::compat::detail::offset_cursor< BidirIt > Class Template Reference

Maps offsets into a non-contiguous range's copy back to the caller's iterators by moving one iterator from the last offset mapped; std::next(first, offset) per mark would rewalk a std::list. More...

Public Member Functions

 offset_cursor ()=default
 Unbound; assigned before use.
 
 offset_cursor (BidirIt it, std::size_t offset)
 Binds the cursor to it, which sits at offset of the sequence.
 
BidirIt to (std::size_t offset)
 Moves to offset, either way.
 

Private Attributes

BidirIt it_ {}
 The caller's iterator at offset_.
 
std::size_t offset_ {}
 Where it_ sits.
 

Detailed Description

template<typename BidirIt>
class real::compat::detail::offset_cursor< BidirIt >

Maps offsets into a non-contiguous range's copy back to the caller's iterators by moving one iterator from the last offset mapped; std::next(first, offset) per mark would rewalk a std::list.

Template Parameters
BidirItThe caller's iterator.

Constructor & Destructor Documentation

◆ offset_cursor()

template<typename BidirIt >
real::compat::detail::offset_cursor< BidirIt >::offset_cursor ( BidirIt  it,
std::size_t  offset 
)
inline

Binds the cursor to it, which sits at offset of the sequence.

Parameters
[in]itAn iterator into the caller's sequence.
[in]offsetIts offset from the sequence start.

Member Function Documentation

◆ to()

template<typename BidirIt >
BidirIt real::compat::detail::offset_cursor< BidirIt >::to ( std::size_t  offset)
inline

Moves to offset, either way.

Parameters
[in]offsetAn offset of the sequence, at most its length.
Returns
The caller's iterator at offset.

The documentation for this class was generated from the following file: