Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85209 - trunk/boost/flyweight
From: joaquin_at_[hidden]
Date: 2013-08-04 10:45:38


Author: joaquin
Date: 2013-08-04 10:45:37 EDT (Sun, 04 Aug 2013)
New Revision: 85209
URL: http://svn.boost.org/trac/boost/changeset/85209

Log:
fixed swap lookup problem in MSVC 9.0 and prior

Text files modified:
   trunk/boost/flyweight/refcounted.hpp | 32 ++++++++++++++++++++++++++++----
   1 files changed, 28 insertions(+), 4 deletions(-)

Modified: trunk/boost/flyweight/refcounted.hpp
==============================================================================
--- trunk/boost/flyweight/refcounted.hpp Sun Aug 4 10:40:24 2013 (r85208)
+++ trunk/boost/flyweight/refcounted.hpp 2013-08-04 10:45:37 EDT (Sun, 04 Aug 2013) (r85209)
@@ -1,4 +1,4 @@
-/* Copyright 2006-2010 Joaquin M Lopez Munoz.
+/* Copyright 2006-2013 Joaquin M Lopez Munoz.
  * Distributed under the Boost Software License, Version 1.0.
  * (See accompanying file LICENSE_1_0.txt or copy at
  * http://www.boost.org/LICENSE_1_0.txt)
@@ -103,7 +103,7 @@
 
   refcounted_handle& operator=(refcounted_handle x)
   {
- swap(*this,x);
+ this->swap(x);
     return *this;
   }
 
@@ -116,9 +116,9 @@
 
   operator const Handle&()const{return h;}
 
- friend void swap(refcounted_handle& x, refcounted_handle& y)
+ void swap(refcounted_handle& x)
   {
- boost::swap(x.h,y.h);
+ std::swap(h,x.h);
   }
 
 private:
@@ -130,8 +130,32 @@
   Handle h;
 };
 
+template<typename Handle,typename TrackingHelper>
+void swap(
+ refcounted_handle<Handle,TrackingHelper>& x,
+ refcounted_handle<Handle,TrackingHelper>& y)
+{
+ x.swap(y);
+}
+
 } /* namespace flyweights::detail */
 
+#if BOOST_WORKAROUND(BOOST_MSVC,<=1500)
+/* swap lookup by boost::swap fails under obscure circumstances */
+
+} /* namespace flyweights */
+
+template<typename Handle,typename TrackingHelper>
+void swap(
+ ::boost::flyweights::detail::refcounted_handle<Handle,TrackingHelper>& x,
+ ::boost::flyweights::detail::refcounted_handle<Handle,TrackingHelper>& y)
+{
+ ::boost::flyweights::detail::swap(x,y);
+}
+
+namespace flyweights{
+#endif
+
 struct refcounted:tracking_marker
 {
   struct entry_type


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk