Boost logo

Boost :

From: Bjorn.Karlsson_at_[hidden]
Date: 2004-02-26 06:15:13


> From: Vladimir Prus [mailto:ghost_at_[hidden]]
>
> The experience in my case is very simple. I had two bugs
> because constructor
> is not explicit. I've just made it explicit locally,
> recomplied and got no
> complication errors, so convenience was not hurted.

Yes, an explicit constructor is safer because it would cause those bugs to
be detected at compile time, but convenience *is* hurt:

  std::vector<boost::any> vec;
  vec.push_back(5);

With an explicit constructor, the above won't work.

Bjorn
 


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