1#ifndef DUNE_COMMON_STD_UTILITY_HH
2#define DUNE_COMMON_STD_UTILITY_HH
18#if __cpp_lib_integer_sequence >= 201304
20 using std::integer_sequence;
21 using std::index_sequence;
22 using std::make_integer_sequence;
23 using std::make_index_sequence;
35 template<
class T, T... Ints >
38 static_assert( std::is_integral< T >::value,
"Template parameter T is required to be an integral type" );
46 static constexpr std::size_t
size () {
return sizeof...( Ints ); }
54 template< std::size_t... Ints >
55 using index_sequence = integer_sequence< std::size_t, Ints... >;
61 template<
typename T, T i, T n, T... indices>
62 struct _make_integer_sequence
63 :
public _make_integer_sequence<T,i+1,n,indices...,i>
66 template<
typename T, T n, T... indices>
67 struct _make_integer_sequence<T,n,n,indices...>
69 using type = integer_sequence<T,indices...>;
76 template<
typename T, T n>
77 using make_integer_sequence =
typename impl::_make_integer_sequence<T,0,n>::type;
79 template<std::
size_t n>
80 using make_index_sequence = make_integer_sequence<std::size_t,n>;
98 template<
typename... T>
99 using index_sequence_for = make_index_sequence<
typename Dune::SizeOf<T...>{}>;
an implementation of std::integer_sequence as introduced in C++14
Definition: utility.hh:37
static constexpr std::size_t size()
return number of elements in sequence
Definition: utility.hh:46
T value_type
value type
Definition: utility.hh:43
Dune namespace.
Definition: alignment.hh:11
Compute size of variadic type list.
Definition: typetraits.hh:566
Traits for type conversions and type information.