5#ifndef DUNE_COMMON_TUPLEVECTOR_HH
6#define DUNE_COMMON_TUPLEVECTOR_HH
36 using Base = std::tuple<T...>;
39 using TupleConstructorDetector =
decltype(Base(std::declval<TT&&>()...));
54 std::enable_if_t<hasTupleConstructor<TT...>::value,
int> = 0>
56 Base(
std::forward<TT>(tt)...)
66 template<std::size_t i,
67 std::enable_if_t<(i <
sizeof...(T)),
int> = 0>
70 return std::get<i>(*
this);
75 template<std::size_t i,
76 std::enable_if_t<(i <
sizeof...(T)),
int> = 0>
79 return std::get<i>(*
this);
83 static constexpr std::size_t
size()
85 return std::tuple_size<Base>::value;
109 template <
size_t i,
typename... Args>
110 struct tuple_element<i,
Dune::TupleVector<Args...> >
112 using type =
typename std::tuple_element<i, std::tuple<Args...> >::type;
119 template <
typename... Args>
120 struct tuple_size<
Dune::TupleVector<Args...> >
121 : std::integral_constant<std::size_t, sizeof...(Args)>
Traits for type conversions and type information.
std::integral_constant< std::size_t, i > index_constant
An index constant with value i.
Definition indices.hh:29
typename detected_or< nonesuch, Op, Args... >::value_t is_detected
Detects whether Op<Args...> is valid.
Definition type_traits.hh:145
Dune namespace.
Definition alignedallocator.hh:13
constexpr auto makeTupleVector(T &&... t)
Definition tuplevector.hh:92
A class augmenting std::tuple by element access via operator[].
Definition tuplevector.hh:35
static constexpr std::size_t size()
Number of elements of the tuple.
Definition tuplevector.hh:83
constexpr TupleVector(TT &&... tt)
Construct from a set of arguments.
Definition tuplevector.hh:55
constexpr TupleVector()
Default constructor.
Definition tuplevector.hh:61
typename std::tuple_element< i, std::tuple< Args... > >::type type
Definition tuplevector.hh:112