kumi v3.1.0
Exquisite Epidote
 
Loading...
Searching...
No Matches

◆ generate()

template<std::size_t N, typename Function >
constexpr auto kumi::generate ( Function const &  f)
inlineconstexprnoexcept

Creates a kumi::tuple containing N applications of the f Callable.

Template Parameters
NNumber of replications
Parameters
fCallable to apply
Returns
A tuple containing N applications of f

Helper type

namespace kumi::result
{
template<std::size_t N, typename Function> struct generate;
template<std::size_t N, typename Function>
using generate_t = typename generate<N, Function>::type;
}
constexpr auto generate(Function const &f) noexcept
Creates a kumi::tuple containing N applications of the f Callable.
Definition generate.hpp:70

Computes the return type of a call to kumi::generate

Example

#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
auto t = [](auto p){ return 42.63 + p; };
std::cout << kumi::generate<7>(t) << "\n";
}