"if" is not evaluated for fields of Class.tupleof

Timoses via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon May 22 23:42:55 PDT 2017


The easiest way is probably casting:

```
import std.traits;
import std.bitmanip;

class Test {
     byte[4] marray;
     byte mbyte;
}

void main() {
     auto value = [0x12, 0x23, 0x34, 0x45, 0x56];
     auto test = cast(Test*) value.ptr;
}
```


More information about the Digitalmars-d-learn mailing list