
"joel" <joel.falcou@lri.fr> schrieb im Newsbeitrag news:4A9CDA69.5080202@lri.fr...
klaus triendl wrote:
I wonder whether a compile-time for-loop is useful enough so that it would get included in the mpl library; it's very similar to what fold does but it can be used for computations with types other than sequence containers.
Well, fold is far more generic than for. I can't see, in a meta-programming context where side-effects don't occur, when having for_ is needed when we have fold_.
fold expects a sequence container; I don't see how I can use fold if I don't have one - see the cross_total metafunction in my initial posting. Like one can't use std::for_each or std::accumulate in every situation - or the usage would get complicated at least -, for_ has its purpose, I think. Klaus