Dune Core Modules (2.7.1)

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
17
18#else // DUNE_HAVE_CXX_EXPERIMENTAL_MAKE_ARRAY
19
21
34 template <typename... Args>
35 std::array<typename std::common_type<Args...>::type, sizeof...(Args)>
36 make_array(const Args&... args) {
37 std::array<typename std::common_type<Args...>::type, sizeof...(Args)>
38 result = {{args...}};
39 return result;
40 }
41
42#endif // DUNE_HAVE_CXX_EXPERIMENTAL_MAKE_ARRAY
43
44}
45}
46
47#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:36
Dune namespace.
Definition: alignedallocator.hh:14
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)