dune-common  2.7.1
indices.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 
4 #ifndef DUNE_COMMON_INDICES_HH
5 #define DUNE_COMMON_INDICES_HH
6 
7 #include <cstddef>
8 #include <type_traits>
9 #include <utility>
10 
11 #include <dune/common/keywords.hh>
12 
13 namespace Dune
14 {
27  template<std::size_t i>
28  using index_constant = std::integral_constant<std::size_t, i>;
29 
30 
31 
48  namespace Indices
49  {
52 
55 
58 
61 
64 
67 
70 
73 
76 
79 
82 
85 
88 
91 
94 
97 
100 
103 
106 
109 
110  } // namespace Indices
111 
122  template<class F, class I, I... i>
123  decltype(auto) unpackIntegerSequence(F&& f, std::integer_sequence<I, i...> sequence)
124  {
125  return f(std::integral_constant<I, i>()...);
126  }
127 
128 } //namespace Dune
129 
130 #endif // DUNE_COMMON_INDICES_HH
Definitions of several macros that conditionally make C++ syntax available.
#define DUNE_INLINE_VARIABLE
Definition: keywords.hh:17
decltype(auto) unpackIntegerSequence(F &&f, std::integer_sequence< I, i... > sequence)
Unpack an std::integer_sequence<I,i...> to std::integral_constant<I,i>...
Definition: indices.hh:123
constexpr index_constant< 16 > _16
Compile time index with value 16.
Definition: indices.hh:99
constexpr index_constant< 15 > _15
Compile time index with value 15.
Definition: indices.hh:96
constexpr index_constant< 8 > _8
Compile time index with value 8.
Definition: indices.hh:75
constexpr index_constant< 7 > _7
Compile time index with value 7.
Definition: indices.hh:72
constexpr index_constant< 0 > _0
Compile time index with value 0.
Definition: indices.hh:51
constexpr index_constant< 9 > _9
Compile time index with value 9.
Definition: indices.hh:78
constexpr index_constant< 14 > _14
Compile time index with value 14.
Definition: indices.hh:93
constexpr index_constant< 1 > _1
Compile time index with value 1.
Definition: indices.hh:54
constexpr index_constant< 3 > _3
Compile time index with value 3.
Definition: indices.hh:60
constexpr index_constant< 12 > _12
Compile time index with value 12.
Definition: indices.hh:87
constexpr index_constant< 11 > _11
Compile time index with value 11.
Definition: indices.hh:84
constexpr index_constant< 18 > _18
Compile time index with value 18.
Definition: indices.hh:105
constexpr index_constant< 13 > _13
Compile time index with value 13.
Definition: indices.hh:90
constexpr index_constant< 5 > _5
Compile time index with value 5.
Definition: indices.hh:66
constexpr index_constant< 17 > _17
Compile time index with value 17.
Definition: indices.hh:102
constexpr index_constant< 10 > _10
Compile time index with value 10.
Definition: indices.hh:81
constexpr index_constant< 2 > _2
Compile time index with value 2.
Definition: indices.hh:57
std::integral_constant< std::size_t, i > index_constant
An index constant with value i.
Definition: indices.hh:28
constexpr index_constant< 19 > _19
Compile time index with value 19.
Definition: indices.hh:108
constexpr index_constant< 6 > _6
Compile time index with value 6.
Definition: indices.hh:69
constexpr index_constant< 4 > _4
Compile time index with value 4.
Definition: indices.hh:63
Dune namespace.
Definition: alignedallocator.hh:14