www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - ctfeonly

reply Nicholas Wilson <iamthewilsonator hotmail.com> writes:
I'd like to add an attribute to indicate that the annotated 
function is only available at compile time so that in cases where 
the operation is invalid at runtime (strings and concatenation on 
a GPU for instance) but the result is only used at compile time 
(for a mixin) the compiler is free to not codegen that function.

I can add this to LDC pretty easily, but does anyone else have a 
use for this (e.g. shrinking binary sizes for mixin heavy 
codebases) and would benefit having this as a standard thing?
Dec 06 2017
parent Nicholas Wilson <iamthewilsonator hotmail.com> writes:
On Thursday, 7 December 2017 at 01:18:04 UTC, Nicholas Wilson 
wrote:
 I'd like to add an attribute to indicate that the annotated 
 function is only available at compile time so that in cases 
 where the operation is invalid at runtime (strings and 
 concatenation on a GPU for instance) but the result is only 
 used at compile time (for a mixin) the compiler is free to not 
 codegen that function.

 I can add this to LDC pretty easily, but does anyone else have 
 a use for this (e.g. shrinking binary sizes for mixin heavy 
 codebases) and would benefit having this as a standard thing?
Urgh, this was meant for general. I'll post it there. Please ignore this.
Dec 06 2017