rvalue references template ?

Timon Gehr timon.gehr at gmx.ch
Mon Jan 2 11:18:59 PST 2012

On 01/02/2012 03:02 PM, Joshua Reusch wrote:
> Is it possible to create a template turning any value into a lvalue?
> This would be helpful if a function expects a reference but you dont
> need the result of the change:
> ///decode(S)(in S str, ref size_t index);
> auto c = std.utf.decode(some_string, lval!0);

Yes, but I currently cannot see a full solution that does not heap-allocate.

More information about the Digitalmars-d-learn mailing list