From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-02-26 06:32:53
>> 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;
> With an explicit constructor, the above won't work.
That's right. I used my case, where convenience was not hurt, to illustrate
the the decision that ctor should not be explicit is not entirely obvious.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk