On 4/11/19 2:13 PM, Alex wrote:
The following code works when I comment out the static if
//static if (__traits(compiles, __traits(getAttributes, T)))
static foreach(a; __traits(getAttributes, T)) Attributes ~=
There seems to be absolutely no reason why this code would fail with the
static if but pass without it but in the first case I get no attributes
because the __traits compiles fails.
__traits(compiles, __traits(getAttributes, T))
vs
__traits(getAttributes, T)
How could it not compile in the first case and yet work in the foreach?
It should. Do you have a larger example? One that can be played with?
-Steve