From cf80d2cf66b06fb740ee736b94b654fe6a51debc Mon Sep 17 00:00:00 2001 From: Gunter Winkler Date: Mon, 22 Mar 2010 22:21:26 +0000 Subject: [PATCH] storage.hpp: see #3968, applied patch to use references instead of copies in swap implementations svn path=/trunk/boost/numeric/ublas/; revision=60780 --- include/boost/numeric/ublas/storage.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/numeric/ublas/storage.hpp b/include/boost/numeric/ublas/storage.hpp index ba176c41..b7f9009b 100644 --- a/include/boost/numeric/ublas/storage.hpp +++ b/include/boost/numeric/ublas/storage.hpp @@ -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); }