From e1effceb2492aa930cb810866c8da437f57a86bb Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 24 Nov 2006 11:36:31 +0000 Subject: Updates to the smart-pointer. --- src/sptr.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/sptr.h b/src/sptr.h index c711a89..51e27b0 100644 --- a/src/sptr.h +++ b/src/sptr.h @@ -30,11 +30,11 @@ public: pRefCnt( NULL ), pData( pSrc ) { - pRefCnt = new uint32_t; + pRefCnt = new int32_t; (*pRefCnt) = 1; } - uint32_t count() + int32_t count() { return *pRefCnt; } @@ -55,6 +55,8 @@ public: pRefCnt = src.pRefCnt; pData = src.pData; (*pRefCnt) += 1; + + return *this; } bool operator==( const SPtr &src ) @@ -78,7 +80,7 @@ private: } } - uint32_t *pRefCnt; + int32_t *pRefCnt; T *pData; }; -- cgit v1.2.3