porting GCC macro to D

Ali Çehreli acehreli at yahoo.com
Fri Apr 4 11:34:20 PDT 2014


On 04/04/2014 08:42 AM, ketmar wrote:

>> You can hack around that limitation if it's acceptable to use a
>> temporary variable:
> sure, and i can rewrite the whole call, passing destination variable as
> template argument. but this looks ugly.

A regular function would work too:

void func0 () { }
int func1 () { return 42; }

int MYMACRO()
{
     func0();
     return func1();
}

void main()
{
     int v = MYMACRO() - 16;
}

Ali



More information about the Digitalmars-d-learn mailing list