Skip to content

Instantly share code, notes, and snippets.

@sithhell
Created January 13, 2013 07:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sithhell/4522812 to your computer and use it in GitHub Desktop.
Save sithhell/4522812 to your computer and use it in GitHub Desktop.
#include <boost/array.hpp>
namespace boost
{
template<typename T>
inline boost::array<T, 0>
make_array()
{
boost::array<T, 0> res;
return res;
}
template<typename T, class... Args>
inline boost::array<T, sizeof...(Args) + 1>
make_array(T&& t, Args&&... args)
{
boost::array<T, sizeof...(Args) + 1> res{
{std::forward<T>(t),
static_cast<T>(std::forward<Args>(args))...}
};
return res;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment