On Saturday, 1 November 2014 at 13:36:05 UTC, Marc Schütz wrote:
On Saturday, 1 November 2014 at 13:30:16 UTC, anonymous wrote:
[...]
auto ref stealFront(R)(ref R r) { import std.range: moveFront, popFront; auto e = r.moveFront; r.popFront; return e; }
[...]
It's probably intended to mean `auto` + `ref`, not `auto ref`. `ref` alone is already sufficient to get type deduction.
But ref is wrong. The function returns a local. Just auto would be fine.