Skip to content

Instantly share code, notes, and snippets.

@rhysd
Created February 23, 2012 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhysd/1894264 to your computer and use it in GitHub Desktop.
Save rhysd/1894264 to your computer and use it in GitHub Desktop.
make_array
template <
class... Args,
class Result = std::array<
typename std::decay<typename std::common_type<Args...>::type>::type,
sizeof...(Args)
>
>
inline Result make_array(Args &&... args)
{
return Result{{ std::forward<Args>(args)... }};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment