Comment corrected (thanks to Joe Gottman)

[SVN r9582]
This commit is contained in:
Beman Dawes
2001-03-19 12:34:12 +00:00
parent 060ea4a573
commit 2d342f0ddf

View File

@@ -250,7 +250,7 @@ template<typename T> 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<typename T> 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);