[dmd-beta] rvalue references

Andrei Alexandrescu andrei at erdani.com
Thu Apr 12 15:21:11 PDT 2012


On 4/12/12 5:16 PM, Dmitry Olshansky wrote:
> void swap(T)(T lhs, T rhs){
> static assert(false, "swap of rvalues has no effect");
> }
>
> void swap(T)(ref T lhs, ref T rhs);
> {
> ... //same trustworthy swap
> }

I'm not sure how well this scales. We're adding as much boilerplate as 
functionality here.


Andrei


More information about the dmd-beta mailing list