Unions and CTFE

2015-12-18 Thread Gianni Pisetta via Digitalmars-d
apper and it does not compile because of unions and CTFE. Also as the error message is very obscure, is it intended behaviour or a bug? module testunionctfe; import std.traits; auto f(T)(T data) { union DataBytes { Unqual!T data; ubyte[T.sizeof] bytes; }; DataBytes tmp; tmp

Re: Unions and CTFE

2015-12-18 Thread Jimmy Cao via Digitalmars-d
n and std.bitmanip.nativeToBigEndian. The code below is the concept used by EndianSwapper and it does not compile because of unions and CTFE. Also as the error message is very obscure, is it intended behaviour or a bug? I think it's intended behavior. According to http://dlang.org/changelog/2.065.0

Re: Unions and CTFE

2015-12-18 Thread Gianni Pisetta via Digitalmars-d
when using std.bitmanip.nativeToLittleEndian and std.bitmanip.nativeToBigEndian. The code below is the concept used by EndianSwapper and it does not compile because of unions and CTFE. Also as the error message is very obscure, is it intended behaviour or a bug? I think it's intende