quote:Original post by Solo
Hmm... I actually started using the technique I described to wrap certain DirectX objects (I actually ended up making a sort of smart pointer/singleton hybrid). Anyway, I always figured that somewhere someone else must have thought of the same technique and documented it, but now I''m not so sure. Perhaps I''ll document the technique in an article. Might make an interesting sweet snippet. Any criticism of the technique not already posted would be greatly appreciated.
A singleton is a singleton, a smart pointer is a smart pointer.
A singleton should not need to worry about copying issues. A smart pointer should never need to worry about access to a single instance. You can use the singleton class to hold a smart pointer that holds a DirectX pointer.