Alias function with arguments

Hakan Aras hakan.aras at live.at
Sat Jul 13 15:39:46 UTC 2019


On Thursday, 11 July 2019 at 03:13:43 UTC, Jamie wrote:
> Is it possible to alias a function and its arguments, but for 
> that function to only be evaluated when the alias is used? For 
> example
>
> alias pragma(inline, true) inline
>
> inline
> void func(){}

What you're asking for is possible (see 
https://run.dlang.io/is/2Lh4Dr for example).

However I don't believe the code sample you're showing is 
possible, because aliases always evaluate to types or values and 
you can't use either of those as a function attribute. Also 
pragmas are not functions.


More information about the Digitalmars-d-learn mailing list