Re: CTFE and cast

2012-01-17 Thread k2
Where can I find a "special hack"? thanks. (2012/01/13 21:58), Don Clugston wrote: > On 13/01/12 10:01, k2 wrote: >> When replace typedef to enum, it became impossible to compile a certain >> portion. >> >> dmd v2.057 Windows >> >> enum HANDLE : void*

Re: CTFE and cast

2012-01-13 Thread Piotr Szturmaj
Don Clugston wrote: > On 13/01/12 10:01, k2 wrote: >> When replace typedef to enum, it became impossible to compile a certain >> portion. >> >> dmd v2.057 Windows >> >> enum HANDLE : void* {init = (void*).init} >> >> pure HANDLE int_to_HANDLE(int x) >> {

Re: CTFE and cast

2012-01-13 Thread Don Clugston
On 13/01/12 10:01, k2 wrote: > When replace typedef to enum, it became impossible to compile a certain > portion. > > dmd v2.057 Windows > > enum HANDLE : void* {init = (void*).init} > > pure HANDLE int_to_HANDLE(int x) > { > return cast(HANDLE)x;

CTFE and cast

2012-01-13 Thread k2
When replace typedef to enum, it became impossible to compile a certain portion. dmd v2.057 Windows enum HANDLE : void* {init = (void*).init} pure HANDLE int_to_HANDLE(int x) { return cast(HANDLE)x; } void bar() { HANDLE a = cast(HANDLE)1;// o