2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-24 04:22:12 +00:00

storage.hpp: see #3968, applied patch to use references instead of copies in swap implementations

This commit is contained in:
Gunter Winkler
2010-03-22 22:21:26 +00:00
parent 70ca83702d
commit 0fcfcd80d3

View File

@@ -1598,13 +1598,13 @@ namespace boost { namespace numeric { namespace ublas {
}
BOOST_UBLAS_INLINE
void swap(self_type rhs) {
void swap(self_type& rhs) {
self_type tmp(rhs);
rhs = *this;
*this = tmp;
}
BOOST_UBLAS_INLINE
friend void swap(self_type lhs, self_type rhs) {
friend void swap(self_type& lhs, self_type& rhs) {
lhs.swap(rhs);
}
@@ -1770,13 +1770,13 @@ namespace boost { namespace numeric { namespace ublas {
}
BOOST_UBLAS_INLINE
void swap(self_type rhs) {
void swap(self_type& rhs) {
self_type tmp(rhs);
rhs = *this;
*this = tmp;
}
BOOST_UBLAS_INLINE
friend void swap(self_type lhs, self_type rhs) {
friend void swap(self_type& lhs, self_type& rhs) {
lhs.swap(rhs);
}