cpp/io/ios base/Init

This class is used to ensure that the default C++ streams (std, std, etc.) are properly initialized and destructed. The class tracks how many instances of it are created and initializes the C++ streams when the first instance is constructed as well as flushes the output streams when the last instance is destructed.

The header behaves as if it defines (directly or indirectly) an instance of  with static storage duration: this makes it safe to access the standard I/O streams in the constructors and destructors of static objects with ordered initialization (as long as  is included in the translation unit before these objects were defined).