6#ifndef SIMPLE_VECTOR_GENERATORS_HPP
7#define SIMPLE_VECTOR_GENERATORS_HPP
28 template <value_type T>
45 template <value_type T>
52 template <value_type T>
54 requires std::weakly_incrementable<T>
72 template <value_type T>
83 template <std::ranges::forward_range TRange>
89 std::ranges::borrowed_range<TRange>,
91 std::remove_cvref_t<TRange>
101 : m_Range{ std::forward<TRange>(
range) },
102 m_Iterator{ std::ranges::begin(m_Range) }
112 return *m_Iterator++;
120 template <std::ranges::forward_range TRange>
Generator which retrieves its values out of the given source iterator.
Definition: Generators.hpp:85
std::conditional_t< std::ranges::borrowed_range< TRange >, TRange, std::remove_cvref_t< TRange > > range_type
Definition: Generators.hpp:92
std::ranges::iterator_t< range_type > iterator_type
Definition: Generators.hpp:93
constexpr value_type operator()()
post-increments the stored iterator and returns a copy of the previously pointed element.
Definition: Generators.hpp:110
constexpr range(TRange &&range)
Constructs the generator with a given range.
Definition: Generators.hpp:100
Checks if the given type is regular and can be used in common arithmetically operations.
Definition: Concepts.hpp:162
range(TRange &&) -> range< TRange >
Definition: Generators.hpp:18
Generator which repeatedly returns the same value on each invocation.
Definition: Generators.hpp:30
constexpr value_type operator()() const noexcept(std::is_nothrow_copy_constructible_v< value_type >)
Copies the stored value and returns it.
Definition: Generators.hpp:39
const value_type value
Definition: Generators.hpp:33
Generator which returns incrementing values on each invocation.
Definition: Generators.hpp:57
value_type value
Definition: Generators.hpp:60
constexpr value_type operator()()
post-increments the stored value and returns a copy
Definition: Generators.hpp:66