isCallableCTFE trait to test whether an expression is callable during CTFE

timotheecour timothee.cour2 at gmail.com
Wed Jul 10 21:08:37 PDT 2013


On Thursday, 11 July 2013 at 03:29:13 UTC, Kenji Hara wrote:
> On Thursday, 11 July 2013 at 03:10:38 UTC, timotheecour wrote:
>> On Thursday, 11 July 2013 at 02:17:13 UTC, Timothee Cour wrote:
> [snip]
>>
>> can we add this to std.traits?
>> it allows (among other things) to write unittests for CTFE, 
>> etc.
>
> Phobos has an internal helper function for testing CTFEable.
> https://github.com/D-Programming-Language/phobos/blob/master/std/exception.d#L1322
>
> Kenji Hara


Mine is more flexible. The one you mention can only work in a 
static assert statement.
We could replace it in terms of static assert(isCallableCTFE!dg) 
but not vice versa.


More information about the Digitalmars-d mailing list