
27 Jul
2007
27 Jul
'07
4:16 p.m.
On 2007-07-27, David Roundy
The solution is to add explicit to the constructor for all single-argument constructors (except perhaps occasionally when you actually want explicit construction of objects).
The reasoning behind this, of course, is to allow nice interactions of home-made classes such as complex numbers, or string classes (which you might want to be automatically constructed from string constants).
I'd have thought that adding an "implicit" keyword would make more sense, and only do conversions then. But I forget, C++. -- Aaron Denney -><-