From: bangerth Date: Fri, 7 Feb 2014 23:01:40 +0000 (+0000) Subject: Remove dealii::swap(SmartPointer,SmartPointer) for MS VC++. It apparently only leads... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12f3e94ba1fdf252f4a710b05758b6cd65e1c37d;p=dealii-svn.git 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 --- 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 /**