5 #ifndef DUNE_COMMON_TUPLEVECTOR_HH 6 #define DUNE_COMMON_TUPLEVECTOR_HH 36 using Base = std::tuple<T...>;
47 class = std::void_t<decltype(Base(std::declval<TT&&>()...))>>
49 Base(std::forward<TT>(tt)...)
59 template<std::size_t
i,
60 std::enable_if_t<(
i <
sizeof...(T)),
int> = 0>
63 return std::get<i>(*this);
68 template<std::size_t
i,
69 std::enable_if_t<(
i <
sizeof...(T)),
int> = 0>
72 return std::get<i>(*this);
76 static constexpr std::size_t
size()
78 return std::tuple_size<Base>::value;
87 TupleVector(T...) -> TupleVector<T...>;
89 template<
class T1,
class T2>
90 TupleVector(std::pair<T1, T2>) -> TupleVector<T1, T2>;
93 TupleVector(std::tuple<T...>) -> TupleVector<T...>;
95 template <
class Alloc,
class... T>
96 TupleVector(std::allocator_arg_t, Alloc, T...) -> TupleVector<T...>;
98 template<
class Alloc,
class T1,
class T2>
99 TupleVector(std::allocator_arg_t, Alloc, std::pair<T1, T2>) -> TupleVector<T1, T2>;
101 template<
class Alloc,
class... T>
102 TupleVector(std::allocator_arg_t, Alloc, std::tuple<T...>) -> TupleVector<T...>;
108 constexpr
auto makeTupleVector(T&&... t)
112 return TupleVector<std::decay_t<T>...>(std::forward<T>(t)...);
125 template <
size_t i,
typename... Args>
126 struct tuple_element<
i,
Dune::TupleVector<Args...> >
128 using type =
typename std::tuple_element<
i, std::tuple<Args...> >
::type;
135 template <
typename... Args>
136 struct tuple_size<
Dune::TupleVector<Args...> >
137 : std::integral_constant<std::size_t, sizeof...(Args)>
141 #endif // DUNE_COMMON_TUPLEVECTOR_HH constexpr TupleVector(TT &&... tt)
Construct from a set of arguments.
Definition: tuplevector.hh:48
std::integral_constant< std::size_t, i > index_constant
An index constant with value i.
Definition: indices.hh:29
I i
Definition: hybridmultiindex.hh:328
Dune namespace
Definition: alignedallocator.hh:12
static constexpr std::size_t size()
Number of elements of the tuple.
Definition: tuplevector.hh:76
typename std::tuple_element< i, std::tuple< Args... > >::type type
Definition: tuplevector.hh:128
Traits for type conversions and type information.
constexpr TupleVector()
Default constructor.
Definition: tuplevector.hh:54
A class augmenting std::tuple by element access via operator[].
Definition: tuplevector.hh:34