#include <GCPtr.hxx>
Inheritance diagram for Countable:

Public Member Functions | |
| Countable () | |
| Constructor for a countable object. | |
| Countable (const Countable &) | |
| virtual | ~Countable () |
| Countable & | operator= (const Countable &) |
It may seem surprising that the IncrementRefCount() and DecrementRefCount() methods are implemented here. This is because of a bug in g++ wherein it is impossible for Counter to declare:
/// template<class T> friend class GCPtr; ///
Definition at line 71 of file GCPtr.hxx.
|
|
Constructor for a countable object. This is mildly tricky. The problem is that for statically allocated objects we need to arrange for the reference count to be incremented by 1 extra to guarantee that the expiration of any GcPtr that points to it does not cause an attempt to deallocate a statically declared object. The following test assumes that the stack grows downwards. |
|
|
|
|
|
|
|
|
|
1.4.6