operator int () const
so that the code below compiles?
struct B
{
B() { }
virtual const B * f() const { return this; }
virtual ~B() { }
};
struct D1 : public B
{
D1() : B() { }
const D1 * f() const { return this; }
~D1() { }
};
int main()
{
const B * const b = new D1;
const int i = * b->f();
return 0;
}
Login in to like
Login in to comment