Request for Comment assert(__ctfe)
tsbockman
thomas.bockman at gmail.com
Sun Apr 5 13:54:19 UTC 2020
On Sunday, 5 April 2020 at 12:11:23 UTC, Stefan Koch wrote:
> They only downside to this, is that giving assert(__ctfe) the
> special meaning to skip codegen might be confusing to some
> people .... then again you wouldn't use assert(__ctfe) unless
> you expect that function to not be available at run-time
>
> What do you guys think?
Ideally it should only skip codegen if there are no statements
with side-effects before the assert(__ctfe). However, I think
it's fine to do it your way if that's easier to implement in the
compiler, as long as normal code gen and optimization is still
enabled for functions containing this construct, as a workaround:
if(!__ctfe) assert(0);
More information about the Digitalmars-d
mailing list