Static unittests?

Dicebot public at dicebot.lv
Mon Aug 5 11:15:20 PDT 2013


On Monday, 5 August 2013 at 17:30:38 UTC, monarch_dodra wrote:
> static assert({int i; assert(i == 0;});

enum i;
static assert(i == 0);

I am really struggling to understand the use case.
D has a tool to force CTFE execution - `enum`. It has a tool for 
compile-time checks - `static assert`. Any possible compile-time 
test can be expressed via those. All assertCTFEable or similar 
tool adds is ability to save on some `static` markers.


More information about the Digitalmars-d mailing list