
16 May
2008
16 May
'08
5:41 p.m.
On 16 May 2008, at 16:49, Noah Roberts wrote:
You can do a lot more than that! Consider the case of a handle of some sort that you need to return to a service when you are done. Case in point, in order to get rid of an sqlite database connection pointer you call db_close(), NOT delete.
No big deal, just use db_close as your deleter!
Is encapsulating the sqlite pointer in an object and having the destructor do that not a better alternative? Other than the time and effort required to develop an encapsulating class I can't think of an example where it is better to do this. Except for stack/static objects. I'm pretty new to C++ though. Thanks, Kevin Martin