31 template <
typename Derived >
36 template <
typename Derived >
41 template <
typename Derived >
46 template <
typename Derived >
51 template <
typename Derived >
61 template <
typename Derived >
64 template <
typename Derived >
67 [[nodiscard]] constexpr Derived& impl() noexcept
69 return static_cast< Derived&
>( *this );
72 [[nodiscard]] constexpr Derived
const& impl()
const noexcept
74 return static_cast< Derived const&
>( *this );
88 using difference_type =
typename std::iterator_traits< Derived >::difference_type;
101 template <
typename Derived >
103 typename std::iterator_traits< Derived >::iterator_category,
104 std::random_access_iterator_tag > )
105 struct generic_iterator< Derived > : public generic_iterator_base< Derived >
107 using generic_iterator_base< Derived >::impl;
109 using difference_type =
typename std::iterator_traits< Derived >::difference_type;
117 constexpr Derived operator++(
int const ) noexcept(
118 nothrow_add_assign< Derived > && std::is_nothrow_copy_constructible_v< Derived > )
131 constexpr Derived operator--(
int const ) noexcept(
132 nothrow_sub_assign< Derived > && std::is_nothrow_copy_constructible_v< Derived > )
139 constexpr Derived
operator+( difference_type v )
const noexcept(
140 nothrow_add_assign< Derived > && std::is_nothrow_copy_constructible_v< Derived > )
147 constexpr Derived
operator-( difference_type v )
const noexcept(
148 nothrow_sub_assign< Derived > && std::is_nothrow_copy_constructible_v< Derived > )
156 template <
typename Derived >
158 typename std::iterator_traits< Derived >::iterator_category,
159 std::bidirectional_iterator_tag > )
160 struct generic_iterator< Derived > : public generic_iterator_base< Derived >
162 using generic_iterator_base< Derived >::impl;
164 constexpr Derived operator++(
int const ) noexcept(
165 nothrow_add_assign< Derived > && std::is_nothrow_copy_constructible_v< Derived > )
172 constexpr Derived operator--(
int const ) noexcept(
173 nothrow_sub_assign< Derived > && std::is_nothrow_copy_constructible_v< Derived > )
181 template <
typename Derived >
183 typename std::iterator_traits< Derived >::iterator_category,
184 std::input_iterator_tag > )
185 struct generic_iterator< Derived > : public generic_iterator_base< Derived >
187 using generic_iterator_base< Derived >::impl;
189 constexpr Derived operator++(
int const ) noexcept(
190 nothrow_add_assign< Derived > && std::is_nothrow_copy_constructible_v< Derived > )
Definition: iterator.h:66
reference const const_reference
Definition: iterator.h:87
constexpr pointer operator->() noexcept(nothrow_dereference< Derived >)
Definition: iterator.h:90
typename std::iterator_traits< Derived >::pointer pointer
Definition: iterator.h:83
typename std::iterator_traits< Derived >::value_type value_type
Definition: iterator.h:82
typename std::iterator_traits< Derived >::iterator_category iterator_category
Definition: iterator.h:85
typename std::iterator_traits< Derived >::const_pointer const_pointer
Definition: iterator.h:84
typename std::iterator_traits< Derived >::reference reference
Definition: iterator.h:86
constexpr const_pointer operator->() const noexcept(nothrow_dereference< Derived >)
Definition: iterator.h:95
typename std::iterator_traits< Derived >::difference_type difference_type
Definition: iterator.h:88
std::variant< int64_t, float, bool, string_buffer > value_type
Definition: base.h:51
MIT License.
Definition: impl.h:31
concept nothrow_dereference
Definition: iterator.h:32
constexpr point< N > operator+(point< N > a, vector< N > const &b)
Returns a result of addition a to b, viz += operator.
Definition: point.h:93
T const * const_pointer
Definition: static_storage.h:104
T & reference
Definition: static_storage.h:101
void copy(Container &&cont, Iterator iter)
Definition: algorithm.h:455
T * pointer
Definition: static_storage.h:103
concept nothrow_equality_compare
Definition: iterator.h:52
concept nothrow_sub_assign
Definition: iterator.h:42
concept nothrow_threeway_compare
Definition: iterator.h:47
requires(!range_container< Container >) const expr std
Returns index of an element in tuple 't', for which call to predicate f(x) holds true,...
Definition: algorithm.h:127
constexpr vector< N > operator-(point< N > a, point< N > const &b)
Returns a result of subtraction of A from B, viz -= operator.
Definition: point.h:84
concept nothrow_add_assign
Definition: iterator.h:37
generic_iterator simplifies custom iterator implementation using CRTP.
Definition: iterator.h:62