Index: matrix.hpp =================================================================== --- matrix.hpp (revision 56193) +++ matrix.hpp (working copy) @@ -180,13 +180,21 @@ } // Assignment +#ifdef BOOST_UBLAS_MOVE_SEMANTICS BOOST_UBLAS_INLINE + matrix &operator = (matrix m) { + assign_temporary(m); + return *this; + } +#else + BOOST_UBLAS_INLINE matrix &operator = (const matrix &m) { size1_ = m.size1_; size2_ = m.size2_; data () = m.data (); return *this; } +#endif template // Container assignment without temporary BOOST_UBLAS_INLINE matrix &operator = (const matrix_container &m) { @@ -1005,11 +1013,19 @@ ~bounded_matrix () {} // Assignment +#ifdef BOOST_UBLAS_MOVE_SEMANTICS BOOST_UBLAS_INLINE + bounded_matrix &operator = (bounded_matrix m) { + matrix_type::operator = (m); + return *this; + } +#else + BOOST_UBLAS_INLINE bounded_matrix &operator = (const bounded_matrix &m) { matrix_type::operator = (m); return *this; } +#endif template // Generic matrix assignment BOOST_UBLAS_INLINE bounded_matrix &operator = (const matrix &m) { @@ -3298,7 +3314,8 @@ size1_ (m.size1_), size2_ (m.size2_) /* , data_ () */ { if (size1_ > N || size2_ > M) bad_size ().raise (); - *this = m; + assign(m); + //*this = m; } template BOOST_UBLAS_INLINE @@ -3382,7 +3399,14 @@ } // Assignment +#ifdef BOOST_UBLAS_MOVE_SEMANTICS BOOST_UBLAS_INLINE + c_matrix &operator = (c_matrix m) { + assign_temporary(m); + return *this; + } +#else + BOOST_UBLAS_INLINE c_matrix &operator = (const c_matrix &m) { size1_ = m.size1_; size2_ = m.size2_; @@ -3390,6 +3414,7 @@ std::copy (m.data_ [i], m.data_ [i] + m.size2_, data_ [i]); return *this; } +#endif template // Container assignment without temporary BOOST_UBLAS_INLINE c_matrix &operator = (const matrix_container &m) { Index: vector.hpp =================================================================== --- vector.hpp (revision 56193) +++ vector.hpp (working copy) @@ -157,11 +157,19 @@ } // Assignment +#ifdef BOOST_UBLAS_MOVE_SEMANTICS BOOST_UBLAS_INLINE + vector &operator = (vector v) { + assign_temporary(v); + return *this; + } +#else + BOOST_UBLAS_INLINE vector &operator = (const vector &v) { data () = v.data (); return *this; } +#endif template // Container assignment without temporary BOOST_UBLAS_INLINE vector &operator = (const vector_container &v) { @@ -550,11 +558,19 @@ ~bounded_vector () {} // Assignment +#ifdef BOOST_UBLAS_MOVE_SEMANTICS BOOST_UBLAS_INLINE + bounded_vector &operator = (bounded_vector v) { + vector_type::operator = (v); + return *this; + } +#else + BOOST_UBLAS_INLINE bounded_vector &operator = (const bounded_vector &v) { vector_type::operator = (v); return *this; } +#endif template // Generic vector assignment BOOST_UBLAS_INLINE bounded_vector &operator = (const vector &v) { @@ -1276,7 +1292,8 @@ size_ (v.size_) /* , data_ () */ { if (size_ > N) bad_size ().raise (); - *this = v; + assign(v); + //*this = v; } template BOOST_UBLAS_INLINE @@ -1359,12 +1376,20 @@ } // Assignment +#ifdef BOOST_UBLAS_MOVE_SEMANTICS BOOST_UBLAS_INLINE + c_vector &operator = (c_vector v) { + assign_temporary(v); + return *this; + } +#else + BOOST_UBLAS_INLINE c_vector &operator = (const c_vector &v) { size_ = v.size_; std::copy (v.data_, v.data_ + v.size_, data_); return *this; } +#endif template // Container assignment without temporary BOOST_UBLAS_INLINE c_vector &operator = (const vector_container &v) {