Passing this to void *

Tim Hsu tim37021 at
Wed Nov 22 15:07:08 UTC 2017

I am a C++ game developer and I want to give it a try.

It seems "this" in Dlang is a reference instead of pointer.

How can I pass it as void *?

void foo(void *);

class Pizza {
     this() {
         Pizza newone = this;
         // works but newone is actually not this pizza.
         // this does not work..

void main() {
     Pizza pizza = new Pizza();
     // this works...

More information about the Digitalmars-d-learn mailing list