Skip to content

Instantly share code, notes, and snippets.

@motonacciu
Created July 27, 2012 20:07
Show Gist options
  • Select an option

  • Save motonacciu/3190205 to your computer and use it in GitHub Desktop.

Select an option

Save motonacciu/3190205 to your computer and use it in GitHub Desktop.
template <size_t N> struct uint_{ };
template <size_t N, typename Lambda, typename IterT>
inline void unroller(const Lambda& f, const IterT& iter, uint_<N>) {
unroller(f, iter, uint_<N-1>());
f(iter + N);
}
template <typename Lambda, typename IterT>
inline void unroller(const Lambda& f, const IterT& iter, uint_<0>) {
f(iter);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment