Re: Rvalue forwarding

2012-02-23 Thread Martin Nowak
On Thu, 23 Feb 2012 08:15:52 +0100, Martin Nowak wrote: Is it possible to forward rvalues through variadic templates? Having to "move" the value for every layer is suboptimal. What am I doing wrong? A working solution was to let move return a proxy which defers the move until it gets implicit

Re: Rvalue forwarding

2012-02-23 Thread H. S. Teoh
On Thu, Feb 23, 2012 at 08:15:52AM +0100, Martin Nowak wrote: > Is it possible to forward rvalues through variadic templates? > Having to "move" the value for every layer is suboptimal. > What am I doing wrong? > > -- > > import std.algorithm : move; > > void foo(Unique!Handle uniq) > {

Rvalue forwarding

2012-02-23 Thread Martin Nowak
Is it possible to forward rvalues through variadic templates? Having to "move" the value for every layer is suboptimal. What am I doing wrong? -- import std.algorithm : move; void foo(Unique!Handle uniq) { auto val = uniq.extract; assert(val._fd == 1); val.close(); } void f