From 2d342f0ddfbe852290b666b812f3acecabd87837 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Mon, 19 Mar 2001 12:34:12 +0000 Subject: [PATCH] Comment corrected (thanks to Joe Gottman) [SVN r9582] --- include/boost/smart_ptr.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/smart_ptr.hpp b/include/boost/smart_ptr.hpp index e549f91..1decce7 100644 --- a/include/boost/smart_ptr.hpp +++ b/include/boost/smart_ptr.hpp @@ -250,7 +250,7 @@ template class shared_ptr { void dispose() { if (--*pn == 0) { delete px; delete pn; } } void share(T* rpx, long* rpn) { - if (pn != rpn) { // assert ((pn==rpn) == (px==rpx)) + if (pn != rpn) { // Q: why not px != rpx? A: fails when both == 0 dispose(); px = rpx; ++*(pn = rpn); @@ -287,7 +287,7 @@ template class shared_array { ~shared_array() { dispose(); } shared_array& operator=(const shared_array& r) { - if (pn != r.pn) { //assert ((pn==r.pn) == (px==r.px)) + if (pn != r.pn) { // Q: why not px != r.px? A: fails when both px == 0 dispose(); px = r.px; ++*(pn = r.pn);