From 06f9c0c72bfc0811b1ab9e5f41f868d4e69cf3fb Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 7 Feb 2014 23:01:40 +0000 Subject: [PATCH] Remove dealii::swap(SmartPointer,SmartPointer) for MS VC++. It apparently only leads to confusion but isn't even strictly necessary. git-svn-id: https://svn.dealii.org/trunk@32437 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/base/smartpointer.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/deal.II/include/deal.II/base/smartpointer.h b/deal.II/include/deal.II/base/smartpointer.h index f61e2b3681..d2435f1883 100644 --- a/deal.II/include/deal.II/base/smartpointer.h +++ b/deal.II/include/deal.II/base/smartpointer.h @@ -472,7 +472,15 @@ SmartPointer::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 &t1, SmartPointer &t2) { t1.swap (t2); } - +#endif /** -- 2.39.5