Boost logo

Boost :

Subject: Re: [boost] Formal Review Request: TypeErasure
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-06-17 14:45:29


AMDG

On 06/17/2012 08:18 AM, Julien Nitard wrote:
> Here are a few questions and suggestions:
>
> - I can create an any of a "smaller" concept from an any of a "bigger"
> concept, but I have to do it explicitly, why ? Couldn't the conversion
> be automatic when dealing with references ?
>

The constructors like

template<class Concept1, class Tag2>
any(const any<Concept2, Tag2>&);

look implicit to me.

> - Why the _self keyword for references ? Wouldn't
> any<mpl::vector<...>&> work and be more intuitive ?
>

It might be more convenient, but it isn't
logically consistent.

any<mpl::vector<...> > is really
any<mpl::vector<...>, _self>,
because of the default argument.

> - Even better, I'd rather have the ref any type has a typedef for the
> value any type.
> typedef any<mpl::vector<...>> MyAnyT;
> MyAnyT value(x);
> MyAnyT::RefT ref(y);
> (and reciprocally MyAnyRefT::ValueT)
>

By design, the only public members of
any are constructors, destructors, and
assignment operators. Any other name
could potentially conflict with a
user-defined member.

> - _self and the placeholders have their underscore at the beginning
> while typeid_ has its own at the end. I guess this may be uniformized.
>

This is following normal boost conventions.
Only placeholders get a leading underscore.

In Christ,
Steven Watanabe


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