May 10, 2011, 9:33 a.m.
posted by madinteger
Implicit conversions have two main problems:
Implicitly converting constructors (constructors that can be called with one argument and are not declared explicit) interact poorly with overloading and foster invisible temporary objects that pop up all over. Conversions defined as member functions of the form operator T (where T is a type) are no betterthey interact poorly with implicit constructors and can allow all sorts of nonsensical code to compile. Examples are embarrassingly numerous (see References). We mention only two (see Examples).
See also the discussion of explicit copy constructors in Item 54.