Boost logo

Ublas :

Subject: Re: [ublas] Move Semantics
From: Nasos Iliopoulos (nasos_i_at_[hidden])
Date: 2009-09-10 10:04:01

Wouldn't changing vectors' operator = allow that?

vector &operator = (const vector &v) {
data () = ();
return *this;

// pass by value for move semantics

vector &operator = (vector v) {
data().swap(; return *this;

and maybe add some checks depending on storage type.

On Fri, 2009-08-28 at 08:24 -0400, Jesse Perla wrote:
Hi there,
> I am writing many routines where I would strongly prefer: matrix<double> f(const matrix<double>& in) to void f(const matrix<double>& in, matrix<double>& out )
> There has been a lot of discussion about this from the C++ groups:
> The move library to support this in C++03
> *
> * Also, I see that this is native to MTL:
> I don't understand expression templates well enough to know the current state in ublas, but is it possible to return large matrices in this way? For example, if I took the following code: and had it return a matrix instead, would that give overhead for large matrices?
> Could I even nest it with no overhead in other vector expressions: e.g.
> matrix<double> C, B; //setup. Assume they are very large
> matrix<double> A = inv(B) + C;
> If this pattern is not usable yet, any idea of when it would be?
> Thanks,
> Jesse
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
Windows Live: Make it easier for your friends to see what you’re up to on Facebook.