It seems pure ain't so pure after all
Walter Bright
newshound1 at digitalmars.com
Mon Oct 1 18:00:37 PDT 2012
On 10/1/2012 1:10 PM, Tommi wrote:
> I meant that all functions would still be
> implicitly CTFEable by default, but an attribute like force_ctfe would
> make it so that the function is guaranteed to execute at compile-time
> when its arguments are compile-time constants.
Since all you need to do to guarantee compile time evaluation is use it
in a context that requires CTFE, which are exactly the cases where you'd
care that it was CTFE'd, I just don't see much utility here.
Note that it is also impossible in the general case for the compiler to
guarantee that a specific function is CTFE'able for all arguments that
are also CTFE'able.
More information about the Digitalmars-d
mailing list