Lumiera  0.pre.03
»edit your freedom«
ios-savepoint.hpp File Reference

Go to the source code of this file.

Description

Capture previous settings of an std::ostream and restore them when leaving scope.

The stream manipulators of the IOS-Framework from the C++ standard lib allow to adjust various aspects of output formatting for following data fed to the output stream. Unfortunately many of these settings are sticky and thus may "taint" common output streams like std::cout. By planting this RAII capsule into a local scope, the internal settings of an output stream can be recorded and restored automatically, once control flow leaves the scope.

Remarks
based on this stackoverflow by «qbert220», 2013
See also
IosSavepoint_test

Definition in file ios-savepoint.hpp.

#include "lib/nocopy.hpp"
#include <ostream>

Classes

class  IosSavepoint
 RAII helper to capture and restore output stream format settings. More...