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::lambdastd::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
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.