Boost logo

Boost :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2002-04-22 11:39:31

I support your suggestion. Here is another argument in favor of an
explicit constructor. I posted it last year on the boost list but
got no replies. :-(


> Hi all,
> I just stumbled across two issues involving any.
> First I think the templated any constructor should be declared
> explicit, because currently this allows the following to be
> compiled:
> struct something
> {
> any value_;
> };
> something value;
> const int dummy_i = boost::any_cast<DWORD>(value);
> The intention was to write "boost::any_cast<DWORD>(value.value_)",
> of course.
> Secondly, the docs for any mention any_ptr in the example section.
> I guess the examples should be rewritten to use any_cast.
> Markus

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