3 #include "utilities/is_tuple.h" 4 #include "utilities/tuple_like.h" 10 template <
typename Func,
typename T,
size_t... Ix>
11 constexpr
auto map(Func&& func,
13 std::index_sequence<Ix...>,
14 std::enable_if_t<!is_tuple_v<std::decay_t<T>>,
int> = 0) {
15 using value_type = decltype(func(tuple_like_getter<0>(t)));
16 return std::array<value_type,
sizeof...(Ix)>{
17 {func(tuple_like_getter<Ix>(t))...}};
20 template <
typename Func,
typename T,
size_t... Ix>
21 constexpr
auto map(Func&& func,
23 std::index_sequence<Ix...>,
24 std::enable_if_t<is_tuple_v<std::decay_t<T>>,
int> = 0) {
25 return std::make_tuple(func(tuple_like_getter<Ix>(t))...);
30 template <
typename Func,
typename T>
31 constexpr
auto map(Func&& func, T&& t) {
32 return map(std::forward<Func>(func),
34 std::make_index_sequence<
35 tuple_like_size_v<decay_const_ref_t<T>>>{});
Definition: allocator.h:6