From bf2e550c9ca594ed8828fc93aa59bbf6a8346009 Mon Sep 17 00:00:00 2001 From: Michael Stevens Date: Thu, 23 Sep 2004 07:19:57 +0000 Subject: [PATCH] Remove member friend swap unrequired for concept and cause compiler wierdness svn path=/trunk/boost/boost/numeric/ublas/; revision=25360 --- include/boost/numeric/ublas/matrix_expression.hpp | 12 +++--------- include/boost/numeric/ublas/vector_expression.hpp | 8 +------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/include/boost/numeric/ublas/matrix_expression.hpp b/include/boost/numeric/ublas/matrix_expression.hpp index 118b889b..37238d36 100644 --- a/include/boost/numeric/ublas/matrix_expression.hpp +++ b/include/boost/numeric/ublas/matrix_expression.hpp @@ -330,17 +330,11 @@ namespace boost { namespace numeric { namespace ublas { // Swapping BOOST_UBLAS_INLINE - void swap (matrix_reference &v) { - if (this != &v) { - expression ().swap (v.expression ()); + void swap (matrix_reference &m) { + if (!same_closure (*this, m)) { + expression ().swap (m.expression ()); } } -#ifndef BOOST_UBLAS_NO_MEMBER_FRIENDS - BOOST_UBLAS_INLINE - friend void swap (matrix_reference &m1, matrix_reference &m2) { - m1.swap (m2); - } -#endif // Closure comparison BOOST_UBLAS_INLINE diff --git a/include/boost/numeric/ublas/vector_expression.hpp b/include/boost/numeric/ublas/vector_expression.hpp index f250cf81..65b2e397 100644 --- a/include/boost/numeric/ublas/vector_expression.hpp +++ b/include/boost/numeric/ublas/vector_expression.hpp @@ -345,16 +345,10 @@ namespace boost { namespace numeric { namespace ublas { // Swapping BOOST_UBLAS_INLINE void swap (vector_reference &v) { - if (this != &v) { + if (!same_closure (*this, v)) { expression ().swap (v.expression ()); } } -#ifndef BOOST_UBLAS_NO_MEMBER_FRIENDS - BOOST_UBLAS_INLINE - friend void swap (vector_reference &v1, vector_reference &v2) { - v1.swap (v2); - } -#endif // Closure comparison BOOST_UBLAS_INLINE