Re: Smart pointers was RE: [GD-General] Compile times
Brought to you by:
vexxed72
From: Jesse J. <jes...@mi...> - 2002-12-17 11:52:31
|
At 11:42 AM -0500 12/16/02, Thatcher Ulrich wrote: >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. This seems right to me and handles seem like a good option if you don't have enough memory to hold all of your objects and you can re-construct them from a resource file or some sort of save file. -- Jesse |