]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Remove dealii::swap(SmartPointer,SmartPointer) for MS VC++. It apparently only leads...
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 7 Feb 2014 23:01:40 +0000 (23:01 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 7 Feb 2014 23:01:40 +0000 (23:01 +0000)
git-svn-id: https://svn.dealii.org/trunk@32437 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/smartpointer.h

index f61e2b3681c31875138ed95bd4056916ed536076..d2435f1883d9de2f1ead35ee4bc3c35f4e170709 100644 (file)
@@ -472,7 +472,15 @@ SmartPointer<T,P>::memory_consumption () const
 
 
 
-
+// The following function is not strictly necessary but is an optimization
+// for places where you call swap(p1,p2) with SmartPointer objects p1, p2.
+// Unfortunately, MS Visual Studio (at least up to the 2013 edition) trips
+// over it when calling std::swap(v1,v2) where v1,v2 are std::vectors of
+// SmartPointer objects: it can't determine whether it should call std::swap
+// or dealii::swap on the individual elements (see bug #184 on our Google Code
+// site. Consequently, just take this function out of the competition for this
+// compiler.
+#ifndef _MSC_VER
 /**
  * Global function to swap the contents of two smart pointers. As both
  * objects to which the pointers point retain to be subscribed to, we
@@ -484,7 +492,7 @@ void swap (SmartPointer<T,P> &t1, SmartPointer<T,Q> &t2)
 {
   t1.swap (t2);
 }
-
+#endif
 
 
 /**

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.