Boost logo

Ublas :

Subject: Re: [ublas] ublas + move semantics
From: Nasos Iliopoulos (nasos_i_at_[hidden])
Date: 2011-12-27 07:40:08


Norman,

for non C++11 copy elision - that has a similar effect as C++11 move
semantics - you can use the compiler option BOOST_UBLAS_MOVE_SEMANTICS
(for gcc -DBOOST_UBLAS_MOVE_SEMANTICS).

See the following for more details:
http://www.boost.org/doc/libs/1_41_0/libs/numeric/ublas/doc/options.htm

Best,
Nasos

On 12/25/2011 01:28 PM, Norman Goldstein wrote:
> I am using boost 1.46.0 on fedora 15, using the -std=c++0x
> flag on gcc, and found that the rvalue reference move semantics
> are not supported. I put the following code into vector.hpp and
> matrix.hpp, and valgrind is happy.
>
> ======== vector.hpp
> BOOST_UBLAS_INLINE
> vector (vector &&v):
> vector_container<self_type> (),
> data_ (NULL){ assign_temporary(v); }
>
>
> ========= matrix.hpp
> BOOST_UBLAS_INLINE
> matrix ( matrix&& m):
> matrix_container<self_type> (),
> size1_ (m.size1_), size2_ (m.size2_), data_ (NULL) {
> assign_temporary(m); }
>
>
> I am not sure if the above code is correct, never mind optimal.
> What are the plans for C++0x in boost/numeric?
>
> Thank you.
>
> PS I first checked the latest boost version, 1.48, and did
> not see the support, there, either.
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: athanasios.iliopoulos.ctr.gr_at_[hidden]