Boost logo

Ublas :

Subject: Re: [ublas] [patch] Move Semantics for uBlas
From: Nasos Iliopoulos (nasos_i_at_[hidden])
Date: 2009-09-15 09:49:52


The problem with bounded_... and c.. is that they allocate space into
the stack, so swaping needs to actually copy their elements, hence
nullifying the effects of move semantics. I think for the bounded_.... classes changing from ownership of the
underlying container to a pointer to them (and necesseary changes in
construction, destruction and swap), will do it (We can right? my mind
is not looping here?). For the c_.... we will probably need to introduce boost::array. The important thing is to keep them
into the stack.

Also, rvalue reference is not a cure for everything. Even with that,
bounded_... and c_... will not be move semantics enabled. Although a first effect of c++0x rvalue references will be that we can enable
prod(A,prod(B,prod(C,prod(D,F)))) without unnecesarry copies.
The standard is getting its final wording and hopefully there will be a semi-final edition for all of us to follow soon.

I may post some c++0x code, just for mind feeding.

Best
Nasos

From: jesseperla_at_[hidden]
Date: Tue, 15 Sep 2009 08:49:23 -0400
To: ublas_at_[hidden]
Subject: Re: [ublas] [patch] Move Semantics for uBlas

On Mon, Sep 14, 2009 at 10:59 PM, Nasos Iliopoulos <nasos_i_at_[hidden]> wrote:

Dear all,
An immediate effect of this patch is the elimination of the need for noalias in types vector<T> and matrix<T>, when assigned to the same type. Although this patch implements move semantics for bounded_ and c_ (vector and matrix) types, they don't have any effect at those types, due to their underlying storage. I included it for possible future exploitation.

Nasos:
This is great, I look forward to playing with it.

What is involved for doing this for bounded_ ? I use them all over the place. Is it tough to do this with C++03 but easier with rvalue references? If so, I don't mind requiring the necessary C++0X features (my target compilers already support it).

Thanks,
Jesse

_________________________________________________________________
Ready for Fall shows? Use Bing to find helpful ratings and reviews on digital tv's.
http://www.bing.com/shopping/search?q=digital+tv's&form=MSHNCB&publ=WLHMTAG&crea=TEXT_MSHNCB_Vertical_Shopping_DigitalTVs_1x1