
That's easier said than done. There are many developers writing code that do whatever works. If the class permits creating multiple instances,
Stewart, Robert wrote: they'll do regardless of whether it's good for them. If the class prevents being used in other than the prescribed manner, then they can't do the wrong thing. While I don't support such programming habits...fine, I'll take that as a point. The rest of my post was this: Take your best singleton class, but remove the bit where it intrudes and forces only a single instantiation. Call this "global", which provides the same thing as a singleton but allows other instantiations of the class. My argument was that this class is more worth boost's time than the singleton class. The reason being, users of global could always re-introduce the single-instantiation behavior, but don't have to. This provides more flexibility.