3#include <Foundation/Types/Delegate.h>
22template <
typename ValueType,
typename IteratorType>
37 PL_DECLARE_POD_TYPE();
39 using iterator_category = std::forward_iterator_tag;
45 PL_FORCE_INLINE
void Next();
46 PL_FORCE_INLINE ValueType Value()
const;
47 PL_ALWAYS_INLINE ValueType operator*()
const {
return Value(); }
48 PL_ALWAYS_INLINE
void operator++() { Next(); }
63 PL_DECLARE_POD_TYPE();
65 using iterator_category = std::forward_iterator_tag;
70 using ConstIterator::Value;
72 PL_FORCE_INLINE ValueType Value();
73 PL_ALWAYS_INLINE ValueType operator*() {
return Value(); }
80 Iterator end() {
return Iterator(
this, m_End()); }
81 ConstIterator begin()
const {
return ConstIterator(
this, m_Begin()); }
82 ConstIterator end()
const {
return ConstIterator(
this, m_End()); }
83 ConstIterator cbegin()
const {
return ConstIterator(
this, m_Begin()); }
84 ConstIterator cend()
const {
return ConstIterator(
this, m_End()); }
87 friend struct Iterator;
88 friend struct ConstIterator;
90 BeginCallback m_Begin;
93 ValueCallback m_Value;
96template <
typename V,
typename I>
99 return in_container.begin();
102template <
typename V,
typename I>
105 return container.cbegin();
108template <
typename V,
typename I>
111 return container.cbegin();
114template <
typename V,
typename I>
117 return in_container.end();
120template <
typename V,
typename I>
123 return container.cend();
126template <
typename V,
typename I>
129 return container.cend();
132#include <Foundation/Types/Implementation/RangeView_inl.h>
This class uses delegates to define a range of values that can be enumerated using a forward iterator...
Definition RangeView.h:24
PL_ALWAYS_INLINE plRangeView(BeginCallback begin, EndCallback end, NextCallback next, ValueCallback value)
Initializes the plRangeView with the delegates used to enumerate the range.
Definition RangeView_inl.h:3
Const iterator, don't use directly, use ranged based for loops or call begin() end().
Definition RangeView.h:36
Iterator, don't use directly, use ranged based for loops or call begin() end().
Definition RangeView.h:62