Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2004-02-29 08:21:17

On 2/26/04 2:36 AM, "Vladimir Prus" <ghost_at_[hidden]> wrote:

> Kevlin Henney wrote:
>> The important point is that implicit conversions from boost::any should
>> not be allowed, and they never have been.
> And that's another question. Conversions *from* boost::any are quite verbose.
> So why try to make boost::any initialisation concise, if further usage is
> still verbose?

The way I generally decide to make a single-argument constructor explicit or
not is:

    Is the argument configuration data, or is supposed to be equivalent to
the new object?

If the argument is configuration data, then the constructor is explicit. If
the new object is supposed to have some sort of equivalence to the argument,
then the constructor is not explicit.

The whole point of boost::any is that _any_ kind of (data) object can be
stored in it; that any object can be converted to a boost::any object. I
feel that the constructor should stay non-explicit then.

Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT hotmail DOT com

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