#pragma once #include namespace siterator { template struct static_iterator; template struct static_iterator> { typedef std::integral_constant type; typedef static_iterator> next; typedef static_iterator> curr; typedef static_iterator> prev; template struct equal : std::false_type { }; template struct equal>> : std::enable_if::value, std::integral_constant>::type { }; }; template static_iterator> uint_iterator() { } template struct static_loop_helper; template struct static_loop_helper { typedef typename Cur::next Next; typedef typename Func::template iteration::type CurFunc; void operator()(Params&&... params) const { CurFunc()(std::forward(params)...); static_loop_helper::value, Params...>()(std::forward(params)...); } }; template struct static_loop_helper { void operator()(Params&&...) const { // end recursion } }; template struct static_loop { void operator()(Params&&... params) const { static_loop_helper::value, Params...>()(std::forward(params)...); } }; template void do_loop(Params&&... params) { static_loop()(std::forward(params)...); } }