On 7 December 2017 at 01:34, Walter Bright via Digitalmars-d < digitalmars-d@puremagic.com> wrote:
> On 12/6/2017 5:21 PM, 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. >> > > Put these functions into a separate import. Then import the file and use > the functions at compile time. They will not have code generated for them. > Misuse of the API; ie, a runtime call, will result in an unsuspecting user getting a surprising link error, rather than a nice compile-time error explaining what they did wrong...