Boost logo

Boost :

Subject: Re: [boost] [mpl] multiset
From: pfultz2 (pfultz2_at_[hidden])
Date: 2015-03-07 17:19:41

> I don't find that defaulting to eager metafunctions is nicer working.
> It has been, at least for me, the source of a lot of pain because
> I was required to write helper metafunctions to branch lazily.
> Plus, when you use lazy metafunctions all the time, you almost
> never have to type `typename f<x>::type` (instead you just use
> `f<x>`), and so the syntax looks pretty much the same as when
> you use template aliases.

I agree. The big reason for having lazy evaluation is conditionals, not
necessarily lambdas and such. The problem is that Boost.MPL is half-lazy
evaluation, which is why things like `typename f<x>::type` need to be

> Regarding the usage of other concepts like Foldable, you say it
> was suggested that everything could be implemented around folds.

I am the one who made the suggestion, however, I didn't say just `Foldable`
alone. I said they could be implemented using `Foldable` and `Insertable`
concepts, as these are essentially dual categories.

Looking at this closer, I don't think there is an efficient way(or at least
have yet to find a way) to implement some algorithms(such as `drop`) using
these concepts. I think a better approach would be how Paul Mensonides
generic data structures in his Chaos library. Its pretty simple and

> This is false in general, because stuff like `transform`

Well, `transform` could be implement using `Foldable` but it may not be the
semantics the user expects.


View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at