ExceptionsThe program-wide facilities cin, cout , and cerr are special and are implemented specially. A factory has to maintain a registry of what function to call to create a given type, and there is typically one registry for the whole program (but preferably it should be internal to the factory rather than a shared global object; see Item 11). Code that does share objects across threads should always serialize all access to those shared objects. (See Item 12 and [Sutter04c].) |