cast ref pointer

Adam D. Ruppe destructionator at gmail.com
Thu Jan 18 16:08:32 UTC 2018


On Thursday, 18 January 2018 at 15:25:38 UTC, Luís Marques wrote:
> I think the underlying idea is sound (use ptr as an lvalue, but 
> with int* type), but since you can't cast(ref int*), I don't 
> know how to express it in D code.

Simply define an intermediate.

int* tmp = cast(int*) that_void_pointer;
foo(tmp);


More information about the Digitalmars-d-learn mailing list