Boost logo

Boost :

Subject: Re: [boost] Boost MPL metafunction shortcut
From: Joel Falcou (joel.falcou_at_[hidden])
Date: 2011-04-11 06:44:58


On 11/04/11 12:18, Aleksey Gurtovoy wrote:
> I considered supporting exactly this type of transformations as a part
> of the standard lambda expansion behavior and ultimately decided against
> it due to [what seemed to me as] a relatively infrequent need for this
> type of code and its limited expressive power: e.g. if you want to
> *remove* type qualifiers, you are back to using type traits library.
> Throw in function types and pointers, which are obviously doable but
> also expensive in terms of number of specializations, and the whole
> thing suddenly looks much less attractive :), at least as a built-in
> mechanism.

The removal is indeed a problem. I tried various stuff but none looked
nice or ended up being type traits redux.

> On the other hand, may be I'm overestimating the
> size/complexity/compile-time cost of implementing this. I guess somebody
> needs to measure and see :).

The problem is that it has an linear cost in term of type modifiers

> Overall, these are reasonable ideas. I have some concerns about the cost
> I've mentioned above, but other than that, I'd be happy to see these in.

I'll try to splat them out in an usable form and try to run some bench.
they can live as undocumented features for a while and see if has some
real life interest.

I think the ::type is maybe better than the type modifier I think.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk