On Wed, 05 Dec 2007 16:02:02 -0600, Robert Dailey wrote:
Your suggestion is good and all, however it doesn't really give me much benefit.
That's fine. The class that was posted earlier was meant to address thread-safety concerns more than anything. If this is not a concern for you, then you are lucky. However, if it is, I would caution you on your use of any Release() function. Ensure that the use of this function is threadsafe. There is a posting here: http://groups.google.com/group/comp.lang.c++.moderated/browse_thread/ thread/e824b5a595066332 That seems to do it in a sensible manner.
If I can find a class that automates this for me JUST by deriving from it, that would be perfect. However this may be too much to ask? Your singleton idea is great, however it doesn't exactly fulfill what I'm looking for. I apologize for not having elaborated on this thoroughly to begin with.
You might look at the singleton library in the Boost Vault under the X- files folder. It seems to be the Swiss Army Knife of singletons and might do what you want. -- Sohail Somani http://uint32t.blogspot.com