From 4b200e984736023549f8724f30a912abf2beaa30 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 19 Nov 2002 18:21:32 +0000 Subject: [PATCH] Borland fix (thanks to Fernando Cacciola) [SVN r16331] --- include/boost/shared_ptr.hpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/include/boost/shared_ptr.hpp b/include/boost/shared_ptr.hpp index e429571..b03a391 100644 --- a/include/boost/shared_ptr.hpp +++ b/include/boost/shared_ptr.hpp @@ -83,8 +83,7 @@ template class shared_ptr { private: - // Borland 5.5.1 specific workarounds -// typedef checked_deleter deleter; + // Borland 5.5.1 specific workaround typedef shared_ptr this_type; // enable_shared_from_this support @@ -126,7 +125,19 @@ public: sp_enable_shared_from_this(p); } -// generated copy constructor, assignment, destructor are fine +// generated copy constructor, assignment, destructor are fine... + +// except on Borland C++ 5.5.1 +#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x551) + + shared_ptr & operator=(shared_ptr const & r) // never throws + { + px = r.px; + pn = r.pn; // shared_count::op= doesn't throw + return *this; + } + +#endif template explicit shared_ptr(weak_ptr const & r): px(r.px), pn(r.pn) // may throw