std::experimental::make_array (3) Linux Manual Page
std::experimental::make_array – std::experimental::make_array
Synopsis
Defined in header<experimental / array>
template <class D = void, class... Types>
(library fundamentals TS v2)
constexpr std::array<VT /* see below */, sizeof...(Types)> make_array(Types &&...t);
Creates a std::array whose size is equal to the number of arguments and whose elements are initialized from the corresponding arguments. Returns std::array<VT, sizeof…(Types)>{std::forward<Types>(t)…}
If D is void, then the deduced type VT is std::common_type_t<Types…>. Otherwise, it is D.
If D is void and any of std::decay_t<Types>… is a specialization of std::reference_wrapper, the program is ill-formed.
Possible implementation
Example
// Run this code
#include <experimental/array>
#include <iostream>
#include <type_traits>
int main()
{
decltype(auto) arr = std::experimental::make_array(1, 2, 3, 4, 5);
bool is_array_of_5_ints = std::is_same<decltype(arr), std::array<int, 5>>::value;
std::cout << "Returns an array of five ints? ";
std::cout << std::boolalpha << is_array_of_5_ints << '\n';
}
Output:
See also
to_array (function template)
