Dune Core Modules (2.8.0)

make_array.hh
1#ifndef DUNE_COMMON_STD_MAKE_ARRAY_HH
2#define DUNE_COMMON_STD_MAKE_ARRAY_HH
3
4#include <array>
5#include <type_traits>
6
7#if DUNE_HAVE_CXX_EXPERIMENTAL_MAKE_ARRAY
8#include <experimental/array>
9#endif
10
11namespace Dune {
12namespace Std {
13
14#if DUNE_HAVE_CXX_EXPERIMENTAL_MAKE_ARRAY
15
18
19#else // DUNE_HAVE_CXX_EXPERIMENTAL_MAKE_ARRAY
20
22
36 template <typename... Args>
37 std::array<typename std::common_type<Args...>::type, sizeof...(Args)>
38 make_array(const Args&... args) {
39 std::array<typename std::common_type<Args...>::type, sizeof...(Args)>
40 result = {{args...}};
41 return result;
42 }
43
44#endif // DUNE_HAVE_CXX_EXPERIMENTAL_MAKE_ARRAY
45
46}
47}
48
49#endif
std::array< typename std::common_type< Args... >::type, sizeof...(Args)> make_array(const Args &... args)
Create and initialize an array.
Definition: make_array.hh:38
Dune namespace.
Definition: alignedallocator.hh:11
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 22, 23:33, 2024)