Boost logo

Boost :

Subject: Re: [boost] [metal] Feature Complete - Request for Feedback
From: Peter Dimov (lists_at_[hidden])
Date: 2017-02-22 18:33:05


Bruno Dutra wrote:
>> And suppose that std::shared_ptr<X> is given to you as a type P, and you
>> don't know if it's shared_ptr or not, so you can't use
>> metal::lambda<std::shared_ptr>?
>
> Excellent observation! We need metal::unwrap
> https://github.com/brunocodutra/metal/issues/58

FWIW, in mp11 for this purpose there's mp_assign, which is defined as

mp_assign<L1<T1...>, L2<T2...>> -> L1<T2...>

so that mp_assign<shared_ptr<X>, metal::list<X const>> is shared_ptr<X
const>.

> Throughout Metal, the concept of equality among Values is expressed by
> metal::same, which is just a n-ary generalization of std::is_same. [...]

> This might seem unimportant, ...

It's not unimportant at all, I find these explanations useful as a design
rationale. It certainly makes sense to keep everything in a normal form so
that metal::same works across the board.


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