Last active
March 18, 2024 07:14
-
-
Save klmr/2775736 to your computer and use it in GitHub Desktop.
C++11 make_array function template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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::forward<T>(values)...}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What are the licensing terms of this gist ?