User:Cooky/ranges/repeat view

@1@ A range factory that generates a sequence of elements by repeatedly producing the same value. Can be either bounded or unbounded (infinite). @2@ and  are expression-equivalent to (has the same effect as)  and  respectively for any suitable subexpressions  and.

Data members
Typical implementation of holds two non-static data members: the beginning value  of wrapped type  and the sentinel value  of type. The names shown here are exposition-only.

Member functions
{{member | {{small|std::ranges::repeat_view::}}repeat_view | 2= {{dcl begin}} {{dcl | num=1 | since=c++23 |1= repeat_view requires std::default_initializable = default; }} {{dcl | num=2 | since=c++23 |1= constexpr explicit repeat_view( const W& value, Bound bound = Bound ); }} {{dcl | num=3 | since=c++23 |1= constexpr explicit repeat_view( W&& value, Bound bound = Bound ); }} {{dcl | num=4 | since=c++23 |1= template < class... WArgs, class... BoundArgs > requires std::constructible_from && std::constructible_from constexpr explicit repeat( std::piecewise_construct_t,                          std::tuple value_args,                           std::tuple bound_args = std::tuple<>{} ); }} {{dcl end}}

@1@ Value-initializes {{tt|value_}} and {{tt|bound_}} via their default member initializers ({{c|1== W}} and {{c|1== Bound}}).

@2@ Initializes {{tt|value_}} with {{c|value}} and initializes {{tt|bound_}} with {{c|bound}}. The behavior is undefined if {{tt|Bound}} is not {{c|std::unreachable_sentinel_t}} and {{c|1=bool(bound >= 0)}} is {{c|false}}.

@3@ Initializes {{tt|value_}} with {{c|std::move(value)}} and initializes {{tt|bound_}} with {{c|bound}}. The behavior is undefined if {{tt|Bound}} is not {{c|std::unreachable_sentinel_t}} and {{c|1=bool(bound >= 0)}} is {{c|false}}.

@4@ Initializes {{tt|value_}} and {{tt|bound_}} through piecewise construction.

Parameters
}}