dune-common  2.5.0
Variables
Dune::Indices Namespace Reference

Namespace with predefined compile time indices for the range [0,19]. More...

Variables

constexpr index_constant< 0 > _0 = {}
 Compile time index with value 0. More...
 
constexpr index_constant< 1 > _1 = {}
 Compile time index with value 1. More...
 
constexpr index_constant< 2 > _2 = {}
 Compile time index with value 2. More...
 
constexpr index_constant< 3 > _3 = {}
 Compile time index with value 3. More...
 
constexpr index_constant< 4 > _4 = {}
 Compile time index with value 4. More...
 
constexpr index_constant< 5 > _5 = {}
 Compile time index with value 5. More...
 
constexpr index_constant< 6 > _6 = {}
 Compile time index with value 6. More...
 
constexpr index_constant< 7 > _7 = {}
 Compile time index with value 7. More...
 
constexpr index_constant< 8 > _8 = {}
 Compile time index with value 8. More...
 
constexpr index_constant< 9 > _9 = {}
 Compile time index with value 9. More...
 
constexpr index_constant< 10 > _10 = {}
 Compile time index with value 10. More...
 
constexpr index_constant< 11 > _11 = {}
 Compile time index with value 11. More...
 
constexpr index_constant< 12 > _12 = {}
 Compile time index with value 12. More...
 
constexpr index_constant< 13 > _13 = {}
 Compile time index with value 13. More...
 
constexpr index_constant< 14 > _14 = {}
 Compile time index with value 14. More...
 
constexpr index_constant< 15 > _15 = {}
 Compile time index with value 15. More...
 
constexpr index_constant< 16 > _16 = {}
 Compile time index with value 16. More...
 
constexpr index_constant< 17 > _17 = {}
 Compile time index with value 17. More...
 
constexpr index_constant< 18 > _18 = {}
 Compile time index with value 18. More...
 
constexpr index_constant< 19 > _19 = {}
 Compile time index with value 19. More...
 

Detailed Description

Namespace with predefined compile time indices for the range [0,19].

The predefined index objects in this namespace are constexpr, which allows them to be used in situations where a compile time constant is needed, e.g. for a template parameter. Apart from that, constexpr implies internal linkage, which helps to avoid ODR problems.

The constants implicitly convert to their contained value, so you can for example write

std::array<int,_10> a;
// the above line is equivalent to
std::array<int,10> b;