Extending the Reference-Counting Pattern
By Vladimir Batov, September 01, 1998
It's often nice to have storage management that's a bit smarter than you get with auto_ptr but rather less complex than automatic garbage collection. Here's one style of smart pointers that strikes such a careful balance.
September 1998/Extending the Reference-Counting Pattern/Listing 2
#include "include/handle.h"
HandleError HandleError::no_error(0);
// max of 16 bits
HandleError HandleError:: unknown(65535);
uint
HandleError::_allocate()
{
static uint next = 0;
return ++next;
}
//End of File