Topic: Changed meaning for old style reference cast?
Author: "Bill Wade" <bill.wade@stoner.com>
Date: 1997/08/28 Raw View
In the ARM an explicit cast to a reference type never invoked any
user-defined conversions.
class foo;
class bar{ public: operator foo&(); }
bar b;
foo& f = (foo&) b; // Changed meaning
In the ARM, the second line was equivalent to
foo& f = *(foo*)&b; // Does not call bar::operator foo&();
the same as a reinterpret_cast<foo&>(b);
It looks like that since at least the Apr 94 draft the cast is treated as a
static_cast<foo&>(b), which does call b.operator foo&().
If I'm missing something here, please let me know.
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]