Does new X() return a pointer or not?

Adam D. Ruppe destructionator at gmail.com
Sat Apr 6 13:36:43 UTC 2019


On Saturday, 6 April 2019 at 13:34:06 UTC, faissaloo wrote:
> ComponentChild is a derived class of Component.

This means it is not a Component*.

new X returns a pointer if X is a struct, but for classes, it is 
not.

> Are objects automatically assumed to be pointers?

Yeah, for classes.




More information about the Digitalmars-d-learn mailing list