Battle-plan for CTFE
Jacob Carlborg via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Mon Aug 29 23:57:25 PDT 2016
On 2016-08-29 10:39, Stefan Koch wrote:
> Thanks guys.
>
> I just came up with a nifty little patch that makes it possible to
> ensure that a function is _only_ used at ctfe.
> Or the opposite.
>
> static assert(__ctfe, "This function is not supposed to be called
> outside of ctfe");
> and static assert(!__ctfe, "This function is not supposed to be called
> during ctfe");
>
> similarly you can use static if (__ctfe).
>
> Is it worth trying to get it into master ?
Wow, absolutely :)
--
/Jacob Carlborg
More information about the Digitalmars-d-announce
mailing list