pop & popFront combined

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Nov 2 03:48:21 PST 2014


On Saturday, 1 November 2014 at 14:19:56 UTC, Nordlöw wrote:
> On Saturday, 1 November 2014 at 13:54:31 UTC, Nordlöw wrote:
>> On Saturday, 1 November 2014 at 13:38:22 UTC, Marc Schütz 
>> wrote:
>>> If you want to avoid the temporary variable, you could write:
>>>
>>>   scope(success) r.popFront;
>>>   return r.moveFront;
>>
>> Does this solution cost performance?
>
> I guess we have to look at the assembler output to be sure. Is 
> there a convenient way to do this in LDC?

ldc2 -O3 -output-s -c test.d

Generates test.s.


More information about the Digitalmars-d-learn mailing list