Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-02-25 05:22:58

I just had a couple of bugs caused by the fact that constructor of boost::any
is not explicit. For example:

   void do_something(boost::any& v) { ... }

   class variable {
        boost::any& value() {}

    variable v;

The intention was to call do_somethin on 'v.value()' but non-explicit ctor is
happy to accept 'variable', after which 'do_something' breaks.

Anybody has an opinion? Is non-explicit ctor really necessary?

- Volodya

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