x026.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <algorithm>
4 #include <array>
5 #include <cmath>
6 #include <iostream>
7 #include <numeric>
8 
9 namespace nmx::apps::x026 {
10 
14 inline void ex1() {
15  enum Idx { a, b, c, d };
16  enum class CIdx { a, b, c, d };
17 
18  std::array<double, 4> v{ 1, 2, 3, 4 };
19  //Zugriff auf Elemente über Index:
20  // mit automatischer Konvertierung in int
21  std::cout << v[Idx::b] << std::endl;
22  //Zugriff auf Elemente über Index:
23  //muss in int konvertiert werden
24  std::cout << v[static_cast<size_t>(CIdx::b)] << std::endl;
25 }
26 
27 } // namespace nmx::apps::x026
Idx
The Idx enum Zugriff auf die Ergebnisse mittels Index.
Definition: x032.h:14
void ex1()
ex1 Aufzählungstypen
Definition: x026.h:14