13#ifndef RANGES_V3_ALGORITHM_GENERATE_HPP
14#define RANGES_V3_ALGORITHM_GENERATE_HPP
20#include <range/v3/algorithm/result_types.hpp>
28#include <range/v3/utility/static_const.hpp>
30#include <range/v3/detail/prologue.hpp>
36 template<
typename O,
typename F>
37 using generate_result = detail::out_fun_result<O, F>;
39 RANGES_FUNC_BEGIN(generate)
45 constexpr generate_result<O, F> RANGES_FUNC(generate)(O
first, S last, F fun)
49 return {detail::move(
first), detail::move(fun)};
53 template(
typename Rng,
typename F)(
55 constexpr generate_result<borrowed_iterator_t<Rng>, F>
56 RANGES_FUNC(generate)(Rng && rng, F fun)
58 return {(*this)(begin(rng), end(rng), ref(fun)).out, detail::move(fun)};
61 RANGES_FUNC_END(generate)
65 using ranges::generate;
66 using ranges::generate_result;
71#include <range/v3/detail/epilogue.hpp>
The output_iterator concept.
The output_range concept.
The sentinel_for concept.
template(typename Rng, typename F)(AND output_range< Rng
This is an overloaded member function, provided for convenience. It differs from the above function o...
typename Fn::template invoke< Args... > invoke
Evaluate the invocable Fn with the arguments Args.
Definition: meta.hpp:541
front< Pair > first
Retrieve the first element of the pair Pair.
Definition: meta.hpp:2251