dune-common  2.7.0
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
Dune::Indices::_3
constexpr index_constant< 3 > _3
Compile time index with value 3.
Definition: indices.hh:60
DUNE_INLINE_VARIABLE
#define DUNE_INLINE_VARIABLE
Preprocessor macro used for marking variables inline on supported compilers.
Definition: keywords.hh:23
Dune::Indices::_8
constexpr index_constant< 8 > _8
Compile time index with value 8.
Definition: indices.hh:75
Dune::Indices::_11
constexpr index_constant< 11 > _11
Compile time index with value 11.
Definition: indices.hh:84
Dune::Indices::_0
constexpr index_constant< 0 > _0
Compile time index with value 0.
Definition: indices.hh:51
Dune::Indices::_18
constexpr index_constant< 18 > _18
Compile time index with value 18.
Definition: indices.hh:105
Dune::unpackIntegerSequence
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
keywords.hh
Definitions of several macros that conditionally make C++ syntax available.
Dune::Indices::_10
constexpr index_constant< 10 > _10
Compile time index with value 10.
Definition: indices.hh:81
Dune::Indices::_5
constexpr index_constant< 5 > _5
Compile time index with value 5.
Definition: indices.hh:66
Dune::Indices::_12
constexpr index_constant< 12 > _12
Compile time index with value 12.
Definition: indices.hh:87
Dune::Indices::_4
constexpr index_constant< 4 > _4
Compile time index with value 4.
Definition: indices.hh:63
Dune::Indices::_6
constexpr index_constant< 6 > _6
Compile time index with value 6.
Definition: indices.hh:69
Dune::Indices::_7
constexpr index_constant< 7 > _7
Compile time index with value 7.
Definition: indices.hh:72
Dune::Indices::_14
constexpr index_constant< 14 > _14
Compile time index with value 14.
Definition: indices.hh:93
Dune::Indices::_16
constexpr index_constant< 16 > _16
Compile time index with value 16.
Definition: indices.hh:99
Dune::Indices::_19
constexpr index_constant< 19 > _19
Compile time index with value 19.
Definition: indices.hh:108
Dune::index_constant
std::integral_constant< std::size_t, i > index_constant
An index constant with value i.
Definition: indices.hh:28
Dune::Indices::_13
constexpr index_constant< 13 > _13
Compile time index with value 13.
Definition: indices.hh:90
Dune::Indices::_2
constexpr index_constant< 2 > _2
Compile time index with value 2.
Definition: indices.hh:57
Dune::Indices::_9
constexpr index_constant< 9 > _9
Compile time index with value 9.
Definition: indices.hh:78
Dune::Indices::_17
constexpr index_constant< 17 > _17
Compile time index with value 17.
Definition: indices.hh:102
Dune::Indices::_1
constexpr index_constant< 1 > _1
Compile time index with value 1.
Definition: indices.hh:54
Dune
Dune namespace.
Definition: alignedallocator.hh:13
Dune::Indices::_15
constexpr index_constant< 15 > _15
Compile time index with value 15.
Definition: indices.hh:96