Revision: 556
http://svn.sourceforge.net/pygccxml/?rev=556&view=rev
Author: roman_yakovenko
Date: 2006-09-18 14:45:16 -0700 (Mon, 18 Sep 2006)
Log Message:
-----------
update smart ptr
Modified Paths:
--------------
pyplusplus_dev/unittests/smart_ptrs/cspc.cpp
Modified: pyplusplus_dev/unittests/smart_ptrs/cspc.cpp
===================================================================
--- pyplusplus_dev/unittests/smart_ptrs/cspc.cpp 2006-09-18 20:42:11 UTC (rev 555)
+++ pyplusplus_dev/unittests/smart_ptrs/cspc.cpp 2006-09-18 21:45:16 UTC (rev 556)
@@ -25,6 +25,31 @@
: pRep(rep), pUseCount( new unsigned int(1) )
{}
+ smart_ptr_t(const smart_ptr_t& r)
+ : pRep(0), pUseCount(0)
+ {
+ pRep = r.get();
+ pUseCount = r.useCountPointer();
+ if(pUseCount){
+ ++(*pUseCount);
+ }
+ }
+
+ smart_ptr_t& operator=(const smart_ptr_t& r){
+ if( pRep == r.pRep ){
+ return *this;
+ }
+
+ release();
+
+ pRep = r.get();
+ pUseCount = r.useCountPointer();
+ if(pUseCount){
+ ++(*pUseCount);
+ }
+ return *this;
+ }
+
template<class Y>
smart_ptr_t(const smart_ptr_t<Y>& r)
: pRep(0), pUseCount(0)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|