boost  

Re: [boost] Re: Optional, tie, and iterator_adaptor

Joel de Guzman
Mon, 01 Sep 2003 01:22:57 +0000

Brian McNamara <[EMAIL PROTECTED]> wrote:

> I should mention in passing that, while in general I think "implicit
> conversions" are bad news and should be avoided whenever reasonable, I
> do think the "conversion to bool" is an exceptional case, simply because
> it is already so deeply ingrained in C++ (and C) language/culture.
> 
> (Fortunately bool has a very narrow interface, so it doesn't get us into
> too much trouble.  Implicit conversions to user-defined types may create
> arbitrary interface conflicts/conceptual ambiguities, and this is where
> the real trouble begins.)

Perhaps, but we were also taught that operator overloading  may create
arbitrary interface conflicts/conceptual ambiguities, and this is where
the real trouble begins ;-)

That may be true in some (many?) contexts, but it is not definitely universally 
true. As I mentioned in another post, I never had, nor seen, any complaints 
about reference_wrapper<T>, which incidentally, has an implicit conversion 
to T. ref(var) has been in extensive use by a lot of libraries for many years now.

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost