Skip to content

Instantly share code, notes, and snippets.

@mujjingun
Created May 17, 2017 08:43
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 mujjingun/20c8d10983e6c2cd731e686bbf35d6b6 to your computer and use it in GitHub Desktop.
Save mujjingun/20c8d10983e6c2cd731e686bbf35d6b6 to your computer and use it in GitHub Desktop.
template<typename T, int first, int... dims>
struct arr_wrap {
static int sfinae[sizeof...(dims) > 0];
using type = typename arr_wrap<typename arr_wrap<T, dims...>::type, first>::type;
};
template<typename T, int n>
struct arr_wrap<T, n> {
using type = T[n];
};
template<typename T, int... dims>
using native_mat = typename arr_wrap<T, dims...>::type;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment