29 #ifndef AURORA_TUPLE_HPP
30 #define AURORA_TUPLE_HPP
45 template <
typename Tuple,
typename Result, std::
size_t N>
48 static Result*
get(Tuple& t, std::size_t i)
51 return &std::get<N-1>(t);
53 return TupleDynamic<Tuple, Result, N-1>::get(t, i);
57 template <
typename Tuple,
typename Result>
58 struct TupleDynamic<Tuple, Result, 0u>
60 static Result*
get(Tuple&, std::size_t)
68 template <
typename SrcTuple,
typename Transformer, std::
size_t N>
74 TupleTransform<SrcTuple, Transformer, N-1>::apply(src),
76 Transformer::transform(std::get<N-1>(src))
81 template <
typename SrcTuple,
typename Transformer>
82 struct TupleTransform<SrcTuple, Transformer, 0u>
84 static std::tuple<> apply(
const SrcTuple&)
86 return std::make_tuple();
102 template <
typename Result,
typename Tuple>
105 const std::size_t N = std::tuple_size<Tuple>::value;
106 return detail::TupleDynamic<Tuple, Result, N>::get(t, i);
128 template <
typename Transformer,
typename SrcTuple>
131 detail::TupleTransform<SrcTuple, Transformer, std::tuple_size<SrcTuple>::value>::apply(src)
134 template <typename Tuple>
144 template <typename Tuple>
147 std::get<std::tuple_size<typename std::remove_reference<Tuple>::type>::value - 1>(t)
152 template <typename T, typename... Us>
153 T& tupleGet(std::tuple<Us...>& tuple)
155 return std::get<detail::IndexOfType<T, Us...>::value>(tuple);
162 #endif // AURORA_TEMPLATES_HPP
Utilities for template metaprogramming.
Metaprogramming helpers for variadic templates.
Configuration header of the library.
Definition: DispatchTraits.hpp:39