public
Created

C++11 make_array template function

  • Download Gist
make_array.hpp
C++
1 2 3 4 5 6 7 8 9 10 11
template <typename... T>
constexpr auto make_array(T&&... values) ->
std::array<
typename std::decay<
typename std::common_type<T...>::type>::type,
sizeof...(T)> {
return std::array<
typename std::decay<
typename std::common_type<T...>::type>::type,
sizeof...(T)>{std::forward<T>(values)...};
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.