Skip to content

Instantly share code, notes, and snippets.

@jbandela
Created May 3, 2013 16:35
Show Gist options
  • Save jbandela/5510834 to your computer and use it in GitHub Desktop.
Save jbandela/5510834 to your computer and use it in GitHub Desktop.
// Adapted from http://stackoverflow.com/questions/12707030/sequence-range-unroll-using-variadic-templates
template<unsigned...> struct indices{};
template<unsigned N, unsigned... Indices>
struct indices_gen : indices_gen<N-1, N-1, Indices...>{};
template<unsigned... Indices>
struct indices_gen<1, Indices...>{
typedef indices<0, Indices...> type;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment