@ctfeonly

Stefan Koch uplink.coder at googlemail.com
Fri Dec 8 14:37:29 UTC 2017


On Friday, 8 December 2017 at 11:48:26 UTC, Nicholas Wilson wrote:
> On Friday, 8 December 2017 at 10:46:20 UTC, John Colvin wrote:
>> On Thursday, 7 December 2017 at 01:21:11 UTC, Nicholas Wilson 
>> wrote:
>>> [...]
>>
>> How would such a thing interact with __traits(compiles, ...) 
>> and is-expressions?
>
> VERY good question, I'm not sure.
>
> From a purely practical perspective I'd say it should pass 
> __traits(compiles, ...)  and is-expressions purely because the 
> kind of things that @ctfeonly would be used to cull from the 
> produced binaries are used as is-expressions (e.g. the template 
> lambda that determines isInputRange), although I expect it use 
> to be rare. Ultimately I think this this feature would fall in 
> to the category of "use responsibly" and it would be the 
> responsibility of the user. They could always reflect on the 
> presence of the attribute if need be.
>
> From a point of consistency, probably however semantic 
> constraints on things like LDC's magic attributes are done. I'm 
> not sure how that is handled, but I suspect that 
> __traits(compiles,...) does not take it into account. Johan?
>
> I will think more on it.
>
> Thanks.

You might want to wait until Dconf 2018 before you start 
implementing something.
As it happens I am working on a way which will make ctfe-only 
functions possible (though that's s side-effect rather then the 
goal)


More information about the Digitalmars-d mailing list