Boost logo

Ublas :

Subject: Re: [ublas] Move Semantics
From: Gunter Winkler (guwi17_at_[hidden])
Date: 2009-09-12 16:11:23


Hello Nasos,

your explanation were very helpful. Could you provide an experimental
patch and a small test program to demonstrate the effects?

I suggest to add a preprocessor condition to enable/disable the move
semantics. This way we could easily add this feature to uBLAS in the
upcoming release without the risk of breaking someones code.

mfg
Gunter

Nasos Iliopoulos schrieb:
> >Take the following:
> [snip examples on move semantics]
> So, one unnecssary temporary here. Of course you could do:
> B=inv(0.5*A); B*=2.0;
>
> Lastly note this:
> matrix<double> B = 2 * inv( .5 * A); will call the copy constructor
> (not move semantics friendly).
> move semantics friendly: matrix<double> B ; B=....
>