19 using iterator_category = std::random_access_iterator_tag;
21 using difference_type = V;
23 using const_pointer = V
const *;
24 using reference = V &;
25 using const_reference = V
const &;
28 typedef std::ptrdiff_t diff_t;
30 iterator operator+=(diff_t step) {
38 iterator operator-=(diff_t step) {
46 iterator operator+(diff_t step) {
47 iterator new_ = _this();
52 iterator operator-(diff_t step) {
53 iterator new_ = _this();
58 diff_t operator-(iterator first) {
60 while (first != _this()) {
68 iterator operator++() {
73 iterator operator--() {
78 iterator operator++(
int) {
79 iterator new_ = _this();
86 iterator operator--(
int) {
87 iterator new_ = _this();
94 reference operator*() {
95 return *_this().get();
98 const_reference operator*()
const {
99 return *_this().get();
102 pointer operator->() {
106 const_pointer operator->()
const {
110 bool operator!=(
const iterator &other)
const {
111 return !(_this() == other);
114 bool operator<(
const iterator &other)
const {
115 return !(_this() >= other);
118 bool operator>=(
const iterator &other)
const {
119 return _this() == other || _this() > other;
122 bool operator<=(
const iterator &other)
const {
123 return _this() == other || _this() < other;
126 bool operator==(
const iterator &other)
const {
127 return _this().eq(other);
130 bool operator>(
const iterator &other)
const {
131 return _this().gt(other);
136 return *
static_cast<iterator *
>(
this);
139 const iterator &_this()
const {
140 return *
static_cast<const iterator *
>(
this);