Created
July 27, 2012 20:07
-
-
Save motonacciu/3190205 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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