|
SpECTRE
v2026.06.09.01
|
Base class to generate methods for a random-access iterator. This class takes the derived class and the (optionally const) value_type of the iterator. The exposed value_type alias will always be non-const, as required by the standard, but the template parameter's constness will affect the reference and pointer aliases. More...
#include <StlBoilerplate.hpp>
Public Types | |
| using | iterator_category = std::random_access_iterator_tag |
| using | value_type = std::remove_const_t<ValueType> |
| using | reference = ValueType& |
| using | pointer = ValueType* |
| using | difference_type = std::ptrdiff_t |
Base class to generate methods for a random-access iterator. This class takes the derived class and the (optionally const) value_type of the iterator. The exposed value_type alias will always be non-const, as required by the standard, but the template parameter's constness will affect the reference and pointer aliases.
The derived class must implement operator*, operator+=, operator- (of two iterators), and operator==.
This class is inspired by Boost's iterator_facade, except that that has a lot of special cases, some of which work poorly because they predate C++11.