August 01, 2013
On Thursday, 1 August 2013 at 22:59:14 UTC, Dicebot wrote:
> ...

To further clarify this, I have used your simplified example:

-------------
// test.d
string generator(int x)
{
    if (x > 0)
    {
        asm
        {
            mov EAX, 0xDEAD;
        }
    }
    return "return 42;";
}

int main()
{
    mixin(generator(0));
}
-------------
$ dmd -release -inline -O test.d
-------------
$ objdump -d test | grep dead
  417705:	b8 ad de 00 00       	mov    $0xdead,%eax
August 02, 2013
On Thursday, 1 August 2013 at 23:15:47 UTC, Dicebot wrote:
> On Thursday, 1 August 2013 at 22:59:14 UTC, Dicebot wrote:
>> ...
>
> To further clarify this, I have used your simplified example:

And in case someone thinks template functions are treated any differently, "string generator(T)(T a)" acts exactly the same.
1 2 3
Next ›   Last »