1 - As Houndie, in request #20 in boost/org/ublas, I
would like to include the rreference operator (&&)
before the matrix parameter:
- fixed_matrix &operator = (fixed_matrix m)
{
+ fixed_matrix &operator = (fixed_matrix
&& m) {
The article tells that to activate the move semantics,
the parameter should be passed by value (as you tell), but
it is not applied the the move constructor or move iterator:
class
Book
{
public
:
Book(std::string
title,
std::vector<std::string>
authors, // <-- Parameter by value
size_t
pub_day
std::string
pub_month,
size_t
pub_year)
:
_title (std::move(title)),
_authors
(std::move(authors)), // <-- The parameter is moved
to member variable
_pub_day
(pub_day),
_pub_month(std::move(pub_month)),
_pub_year
(pub_year)
{}
//
....
//
....
};
2 - AFAIK, with the implementation of move semantics has
not deprecated the copy semantics. As it is defined in the
source code, it looks like that move semantic could not be
used with copy semantics. Both semantics should be used at
the same time in a C++11 compiler:
// Copy semantics
matrix m1;
matrix m2(m1);
m2 = m1;
// Move semantics
matrix m1;
matrix m2(std::move(m1));
m3 = std::move(m2);
Please, could you confirm that move operators are defined
as expected?
Thanks and Best Regards,
Joaquim Duran