Does new X() return a pointer or not?

rikki cattermole rikki at cattermole.co.nz
Sat Apr 6 13:38:02 UTC 2019


On 07/04/2019 2:34 AM, faissaloo wrote:
> Are objects automatically assumed to be pointers?

It is a reference. Which is a fancy way of saying pointer under the hood.

Just don't do pointer arithmetic with it ;)

Object* means a pointer to a class object reference. Which isn't what 
you were intending.
int* means a pointer to a 4-byte signed integer.

Does that make sense?


More information about the Digitalmars-d-learn mailing list