pop & popFront combined
    via Digitalmars-d-learn 
    digitalmars-d-learn at puremagic.com
       
    Sat Nov  1 06:38:21 PDT 2014
    
    
  
On Saturday, 1 November 2014 at 13:25:03 UTC, Nordlöw wrote:
> On Saturday, 1 November 2014 at 13:22:34 UTC, Nordlöw wrote:
>> https://github.com/nordlow/justd/blob/master/range_ex.d#L14
>>
>> Please comment!
>
> What's the recommended way of making stealFront and stealBack 
> inout here? Can I somehow use auto ref together with inout?
If you want to avoid the temporary variable, you could write:
     scope(success) r.popFront;
     return r.moveFront;
    
    
More information about the Digitalmars-d-learn
mailing list