Re: No implicitly convert derived ptr to base ptr?

2012-04-24 Thread Timon Gehr
On 04/25/2012 07:50 AM, Nick Sabalausky wrote: The compiler rejects this: class Base {} class Derived : Base {} void main() { Base*basePtr; Derived* derivedPtr; basePtr = derivedPtr; // ERROR } Is that really correct that it shouldn't be

Re: No implicitly convert derived ptr to base ptr?

2012-04-24 Thread Jonathan M Davis
On Wednesday, April 25, 2012 01:50:51 Nick Sabalausky wrote: > The compiler rejects this: > > class Base {} > class Derived : Base {} > > void main() > { > Base*basePtr; > Derived* derivedPtr; > > basePtr = derivedPtr; // ERROR > } > > Is that rea

No implicitly convert derived ptr to base ptr?

2012-04-24 Thread Nick Sabalausky
The compiler rejects this: class Base {} class Derived : Base {} void main() { Base*basePtr; Derived* derivedPtr; basePtr = derivedPtr; // ERROR } Is that really correct that it shouldn't be allowed?