Skip to content

Instantly share code, notes, and snippets.

@JohanMabille
Created January 7, 2020 10:07
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 JohanMabille/cddb42f42b564b024d52b1c6f1a43b26 to your computer and use it in GitHub Desktop.
Save JohanMabille/cddb42f42b564b024d52b1c6f1a43b26 to your computer and use it in GitHub Desktop.
template <class R, class U, size_t... I>
constexpr initializer_shape(U t, std::index_sequence<I...>)
{
using size_type = typename R::value_type;
return R{size_type(initializer_shape_impl<I>::value(t))...};
}
template <class R, class T>
constexpr R shape(T t)
{
return initializer_shape<R>(t, std::make_index_sequence<
initializer_dimension<decltype(t)>::value>());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment