dune-common  2.9.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 // SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
4 // SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
5 
6 #ifndef DUNE_COMMON_INDICES_HH
7 #define DUNE_COMMON_INDICES_HH
8 
9 #include <cstddef>
10 #include <type_traits>
11 #include <utility>
12 
13 #include <dune/common/keywords.hh>
14 
15 namespace Dune
16 {
29  template<std::size_t i>
30  using index_constant = std::integral_constant<std::size_t, i>;
31 
32 
33 
50  namespace Indices
51  {
54 
57 
60 
63 
66 
69 
72 
75 
78 
81 
84 
87 
90 
93 
96 
99 
102 
105 
108 
111 
112  } // namespace Indices
113 
124  template<class F, class I, I... i>
125  decltype(auto) constexpr unpackIntegerSequence(F&& f, std::integer_sequence<I, i...> sequence)
126  {
127  return f(std::integral_constant<I, i>()...);
128  }
129 
130 } //namespace Dune
131 
132 #endif // DUNE_COMMON_INDICES_HH
Definitions of several macros that conditionally make C++ syntax available.
#define DUNE_INLINE_VARIABLE
Definition: keywords.hh:19
constexpr index_constant< 16 > _16
Compile time index with value 16.
Definition: indices.hh:101
constexpr index_constant< 15 > _15
Compile time index with value 15.
Definition: indices.hh:98
constexpr index_constant< 8 > _8
Compile time index with value 8.
Definition: indices.hh:77
constexpr index_constant< 7 > _7
Compile time index with value 7.
Definition: indices.hh:74
constexpr index_constant< 0 > _0
Compile time index with value 0.
Definition: indices.hh:53
constexpr index_constant< 9 > _9
Compile time index with value 9.
Definition: indices.hh:80
constexpr index_constant< 14 > _14
Compile time index with value 14.
Definition: indices.hh:95
constexpr index_constant< 1 > _1
Compile time index with value 1.
Definition: indices.hh:56
constexpr index_constant< 3 > _3
Compile time index with value 3.
Definition: indices.hh:62
constexpr index_constant< 12 > _12
Compile time index with value 12.
Definition: indices.hh:89
decltype(auto) constexpr 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:125
constexpr index_constant< 11 > _11
Compile time index with value 11.
Definition: indices.hh:86
constexpr index_constant< 18 > _18
Compile time index with value 18.
Definition: indices.hh:107
constexpr index_constant< 13 > _13
Compile time index with value 13.
Definition: indices.hh:92
constexpr index_constant< 5 > _5
Compile time index with value 5.
Definition: indices.hh:68
constexpr index_constant< 17 > _17
Compile time index with value 17.
Definition: indices.hh:104
constexpr index_constant< 10 > _10
Compile time index with value 10.
Definition: indices.hh:83
constexpr index_constant< 2 > _2
Compile time index with value 2.
Definition: indices.hh:59
std::integral_constant< std::size_t, i > index_constant
An index constant with value i.
Definition: indices.hh:30
constexpr index_constant< 19 > _19
Compile time index with value 19.
Definition: indices.hh:110
constexpr index_constant< 6 > _6
Compile time index with value 6.
Definition: indices.hh:71
constexpr index_constant< 4 > _4
Compile time index with value 4.
Definition: indices.hh:65
Dune namespace.
Definition: alignedallocator.hh:13