1 #ifndef SIPLASPLAS_UTILITY_TUPLE_HPP 2 #define SIPLASPLAS_UTILITY_TUPLE_HPP 13 template<
typename Function,
typename... Args, std::size_t... Is>
14 constexpr
auto tuple_call(Function
function,
const std::tuple<Args...>& tuple, meta::index_sequence<Is...>)
16 return function(std::forward<Args>(std::get<Is>(tuple))...);
19 template<
typename Head,
typename... Tail, std::size_t... Is>
20 constexpr
auto tuple_tail(
const std::tuple<Head, Tail...>& tuple, std::index_sequence<Is...>)
22 return std::make_tuple(std::forward<std::tuple_element_t<Is+1, std::tuple<Head, Tail>>>(std::get<Is+1>(tuple))...);
27 template<
typename Function,
typename... Args>
28 constexpr
auto tuple_call(Function
function,
const std::tuple<Args...>& tuple)
30 return tuple_call(
function, tuple, meta::make_index_sequence_for<Args...>{});
33 template<
typename Function,
typename... Args>
34 constexpr
auto tuple_call(
const std::tuple<Args...>& tuple, Function
function)
36 return tuple_call(
function, tuple);
40 template<
typename Head,
typename... Tail>
41 constexpr
auto tuple_tail(
const std::tuple<Head, Tail...>& tuple)
43 return tuple_tail(tuple, std::index_sequence_for<Tail...>{});
48 #endif // SIPLASPLAS_UTILITY_TUPLE_HPP Definition: canary_allocator.hpp:7