
8 Jul
2010
8 Jul
'10
12:21 p.m.
On 07/07/10 20:26, Larry Evans wrote: [snip]
Sounds like the if_recur template metaprogram found here:
http://svn.boost.org/svn/boost/sandbox/variadic_templates/boost/mpl/if_recur...
does what your asking, except for templates, not values. I'd guess it could serve as a guide on how to do it for values.
[snip] Further explanation is found here: http://article.gmane.org/gmane.comp.lib.boost.devel/190063 which also mentions a limitation of the if_recur, i.e. it cannot short-circuit going up the "recursion stack". As also mentioned in that post, a while_ with explicit stack can be used to do the short-circuiting going up.