CTFE Status
Stefan Koch via Digitalmars-d
digitalmars-d at puremagic.com
Mon Dec 5 05:55:22 PST 2016
On Monday, 5 December 2016 at 07:55:32 UTC, deadalnix wrote:
> On Monday, 5 December 2016 at 04:26:35 UTC, Stefan Koch wrote:
>> I just improved the handling of void initializations.
>> Now the code is less pessimistic and will allow them if they
>> are assigned to before use.
>> However using void variables at ctfe will not result in any
>> performance wins.
>
> Void initialization are allowed at CTFE ?
the following code will compile just fine.
uint fn(uint a) {
int b = void;
if (a == 2)
{
b = 1;
}
return b; // only fine is a was 2;
}
static assert(fn(2) == 1);
More information about the Digitalmars-d
mailing list