Re: Smart pointers was RE: [GD-General] Compile times
Brought to you by:
vexxed72
From: Thatcher U. <tu...@tu...> - 2002-12-16 16:46:40
|
On Dec 16, 2002 at 04:05 -0800, Jesse Jones wrote: > At 8:16 PM -0600 12/15/02, brian hook wrote: > >Assuming that we're defining "smart pointer" as ref-counted, > >templatized pointer access, then here are the typical bugaboos: [snip] > Well, what are the options? Brian and Ignacio mentioned handles. It seems to me that handles are equivalent to smart pointers, with a few differences in details. The similarities: * If your handle manager keeps a ref-count (or something similar) to avoid deleting an object that has an active handle, then handles essentially behave like ref-counted smart pointers. * If your handle manager is allowed to delete objects when it feels like it, then handles are essentially the same as weak pointers, with a strong pointer in the handle manager. And the differences: * Weak pointers are bigger than handles (the implementation we use has an object pointer plus two list link pointers). * Handles are hard to debug! * Handles involve a little extra plumbing in the client, to extract a real pointer. -- Thatcher Ulrich http://tulrich.com |