Boost logo

Boost :

From: Bo Persson (bop_at_[hidden])
Date: 2005-07-29 07:00:25


"Jason Hise" <chaos_at_[hidden]> skrev i meddelandet
news:42E9A2B1.4020407_at_ezequal.com...

> Why does the C++ language have to ban such potentially fun things as
> infinite implicit conversion chains and overloading the dot operator?

Because it would force the compiler to create conversion chains thru any
unrelated types, that just happen to be present. Combine that with
overload resolution, C style type promotions, and templates, and you
have got what? A real mess!

struct x
{
   operator int();
};

struct y
{
};

Here, an x isn't convertible to a y. Good!

struct z
{
    z(int);
   operator y();
};

Now they would be!

Bo Persson


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