Request for Comment assert(__ctfe)
Stefan Koch
uplink.coder at googlemail.com
Wed Apr 8 09:48:25 UTC 2020
On Wednesday, 8 April 2020 at 09:11:45 UTC, Dennis wrote:
> On Wednesday, 8 April 2020 at 08:42:52 UTC, Stefan Koch wrote:
>> When existing the language is perfectly able to express (only
>> runs at ctfe).
>
> assert(__ctfe) does not express that you STATICALLY know it
> only runs at ctfe, it is a RUNTIME error and it is impossible
> to statically decide whether the function may actually get
> called outside ctfe context.
The only reason why I used assert (__ctfe) not static assert
(__ctfe) is because that's impossible to express.
since __ctfe is a magic runtime variable that's hardwired to be
zero in the non-ctfe case.
More information about the Digitalmars-d
mailing list