MCPcopy Create free account
hub / github.com/boostorg/histogram / iterator_mixin

Class iterator_mixin

include/boost/histogram/axis/base.hpp:112–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110/// Iterator mixin, uses CRTP to inject iterator logic into Derived.
111template <typename Derived>
112class iterator_mixin {
113public:
114 using const_iterator = iterator_over<Derived>;
115 using const_reverse_iterator = reverse_iterator_over<Derived>;
116
117 const_iterator begin() const noexcept {
118 return const_iterator(*static_cast<const Derived*>(this), 0);
119 }
120 const_iterator end() const noexcept {
121 return const_iterator(*static_cast<const Derived*>(this),
122 static_cast<const Derived*>(this)->size());
123 }
124 const_reverse_iterator rbegin() const noexcept {
125 return const_reverse_iterator(*static_cast<const Derived*>(this),
126 static_cast<const Derived*>(this)->size());
127 }
128 const_reverse_iterator rend() const noexcept {
129 return const_reverse_iterator(*static_cast<const Derived*>(this), 0);
130 }
131};
132
133} // namespace axis
134} // namespace histogram

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected