19 #ifndef PONGASOFT_JAMBA_STL_H 20 #define PONGASOFT_JAMBA_STL_H 28 template<
typename T,
typename U,
typename F, std::size_t N, std::size_t... I>
29 constexpr std::array<U, N>
transformArray(std::array<T, N>
const &a, F &&f, std::index_sequence<I...>)
31 return { f(a[I])... };
39 template<
typename T,
typename U,
typename F, std::
size_t N,
typename Indices = std::make_index_sequence<N>>
40 constexpr std::array<U, N>
transform(std::array<T, N>
const &a, F &&f)
42 return impl::transformArray<T, U>(a, std::forward<F>(f), Indices{});
47 #endif //PONGASOFT_JAMBA_STL_H constexpr std::array< U, N > transformArray(std::array< T, N > const &a, F &&f, std::index_sequence< I... >)
Definition: stl.h:29
constexpr std::array< U, N > transform(std::array< T, N > const &a, F &&f)
Transforms an array containing elements of type T into an array containing elements of type U by appl...
Definition: stl.h:40