OGLplus  (0.59.0) a C++ wrapper for rendering APIs

make_array.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_MAKE_ARRAY_HPP
10 #define EAGINE_MAKE_ARRAY_HPP
11 
12 #include "all_are_same.hpp"
13 #include <array>
14 #include <type_traits>
15 
16 namespace eagine {
17 
18 // TODO use std::experimental::make_array when available
19 
20 template <typename T, typename... P>
21 static constexpr std::
22  enable_if_t<all_are_same<T, P...>::value, std::array<T, 1 + sizeof...(P)>>
23  make_array(T v, P... p) {
24  return {{std::move(v), std::move(p)...}};
25 }
26 
27 } // namespace eagine
28 
29 #endif // EAGINE_MAKE_ARRAY_HPP
Common code is placed in this namespace.
Definition: eagine.hpp:21

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).