my library should be compiled with command option -dip1000 but I cann't to determine it in static assert. memory corruption can occur without it. static assert at CT is better than random crashed application. for future when u add option to compiler for any DIP please add appropriate version too. if such version exists then update documentation too https://dlang.org/spec/version.html#predefined-versions
Try this: template A() { int[] f(scope int[] a) @safe { return a; } } static assert(!__traits(compiles,A!()));
(In reply to anonymous4 from comment #1) > > Try this: > > template A() { > int[] f(scope int[] a) @safe { return a; } > } > static assert(!__traits(compiles,A!())); thank you. current workaround: template isDip1000EnabledImpl() { private template A() { int[] f( scope int[] a) @safe { return a; } } public enum isDip1000EnabledImpl = !__traits( compiles, A!()); } alias isDip1000Enabled = isDip1000EnabledImpl!();
The workaround looks sufficient.