E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ wide() [2/2]

template<arithmetic_scalar_value Type, typename Cardinal >
template<eve::invocable< size_type > Generator>
eve::wide< Type, Cardinal >::wide ( Generator &&  g)
inlinenoexcept

The Callable Object must satisfy the following prototype:

T generator(std::ptrdiff_t index);
Definition generator.hpp:30
typename decltype(detail::as_translated_type(as< T >{}))::type translate_t
Returns the final translated type of T.
Definition translation.hpp:107


and is supposed to return the value computed from the current index to store at said index.

Parameters
gThe Callable Object to use as a value generator

Example:

#include <eve/wide.hpp>
#include <iostream>
int main()
{
// Generates the wide [0 2 4 ... ]
eve::wide<int> r = [](auto i) { return i * 2; };
std::cout << r << "\n";
}