@ctfeonly

Manu turkeyman at gmail.com
Thu Dec 7 19:41:49 UTC 2017


On 7 December 2017 at 01:34, Walter Bright via Digitalmars-d <
digitalmars-d at 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...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20171207/f8d1b710/attachment.html>


More information about the Digitalmars-d mailing list