Dune Core Modules (2.9.1)

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// 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
14
15namespace 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 {
53 DUNE_INLINE_VARIABLE constexpr index_constant< 0> _0 = {};
54
56 DUNE_INLINE_VARIABLE constexpr index_constant< 1> _1 = {};
57
59 DUNE_INLINE_VARIABLE constexpr index_constant< 2> _2 = {};
60
62 DUNE_INLINE_VARIABLE constexpr index_constant< 3> _3 = {};
63
65 DUNE_INLINE_VARIABLE constexpr index_constant< 4> _4 = {};
66
68 DUNE_INLINE_VARIABLE constexpr index_constant< 5> _5 = {};
69
71 DUNE_INLINE_VARIABLE constexpr index_constant< 6> _6 = {};
72
74 DUNE_INLINE_VARIABLE constexpr index_constant< 7> _7 = {};
75
77 DUNE_INLINE_VARIABLE constexpr index_constant< 8> _8 = {};
78
80 DUNE_INLINE_VARIABLE constexpr index_constant< 9> _9 = {};
81
83 DUNE_INLINE_VARIABLE constexpr index_constant<10> _10 = {};
84
86 DUNE_INLINE_VARIABLE constexpr index_constant<11> _11 = {};
87
89 DUNE_INLINE_VARIABLE constexpr index_constant<12> _12 = {};
90
92 DUNE_INLINE_VARIABLE constexpr index_constant<13> _13 = {};
93
95 DUNE_INLINE_VARIABLE constexpr index_constant<14> _14 = {};
96
98 DUNE_INLINE_VARIABLE constexpr index_constant<15> _15 = {};
99
101 DUNE_INLINE_VARIABLE constexpr index_constant<16> _16 = {};
102
104 DUNE_INLINE_VARIABLE constexpr index_constant<17> _17 = {};
105
107 DUNE_INLINE_VARIABLE constexpr index_constant<18> _18 = {};
108
110 DUNE_INLINE_VARIABLE constexpr index_constant<19> _19 = {};
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
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
Definitions of several macros that conditionally make C++ syntax available.
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)