bearophile wrote:
Ali Çehreli Wrote:
Coming from C++, I wonder whether it is ever needed to get the address
of the object? If so, how?
I've never had to do this in D. I think you can just cast the class reference
to void* and then to the pointer you want, something like (untested):
Foo f =
Ali Ãehreli Wrote:
> Coming from C++, I wonder whether it is ever needed to get the address
> of the object? If so, how?
I've never had to do this in D. I think you can just cast the class reference
to void* and then to the pointer you want, something like (untested):
Foo f = new Foo;
auto p
Coming from C++, I wonder whether it is ever needed to get the address
of the object? If so, how?
The & operator below produces the address of the class reference
(variable). How about the class object?
class C
{}
void main()
{
auto variable = new C;
auto address = &variable;
}
Than