Dune Core Modules (2.8.0)

indices.hh
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
12
13namespace 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 {
51 DUNE_INLINE_VARIABLE constexpr index_constant< 0> _0 = {};
52
54 DUNE_INLINE_VARIABLE constexpr index_constant< 1> _1 = {};
55
57 DUNE_INLINE_VARIABLE constexpr index_constant< 2> _2 = {};
58
60 DUNE_INLINE_VARIABLE constexpr index_constant< 3> _3 = {};
61
63 DUNE_INLINE_VARIABLE constexpr index_constant< 4> _4 = {};
64
66 DUNE_INLINE_VARIABLE constexpr index_constant< 5> _5 = {};
67
69 DUNE_INLINE_VARIABLE constexpr index_constant< 6> _6 = {};
70
72 DUNE_INLINE_VARIABLE constexpr index_constant< 7> _7 = {};
73
75 DUNE_INLINE_VARIABLE constexpr index_constant< 8> _8 = {};
76
78 DUNE_INLINE_VARIABLE constexpr index_constant< 9> _9 = {};
79
81 DUNE_INLINE_VARIABLE constexpr index_constant<10> _10 = {};
82
84 DUNE_INLINE_VARIABLE constexpr index_constant<11> _11 = {};
85
87 DUNE_INLINE_VARIABLE constexpr index_constant<12> _12 = {};
88
90 DUNE_INLINE_VARIABLE constexpr index_constant<13> _13 = {};
91
93 DUNE_INLINE_VARIABLE constexpr index_constant<14> _14 = {};
94
96 DUNE_INLINE_VARIABLE constexpr index_constant<15> _15 = {};
97
99 DUNE_INLINE_VARIABLE constexpr index_constant<16> _16 = {};
100
102 DUNE_INLINE_VARIABLE constexpr index_constant<17> _17 = {};
103
105 DUNE_INLINE_VARIABLE constexpr index_constant<18> _18 = {};
106
108 DUNE_INLINE_VARIABLE constexpr index_constant<19> _19 = {};
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
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
Definitions of several macros that conditionally make C++ syntax available.
Namespace with predefined compile time indices for the range [0,19].
Definition: indices.hh:49
Dune namespace.
Definition: alignedallocator.hh:11
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)