diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:08:27 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-09-15 01:08:27 +0200 |
| commit | c9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c (patch) | |
| tree | 3e4f42f93c7ae89a364e4d51fff6e5cec4e55fa9 /graphs/cpp/cartesian_vector/state_saver.hh | |
add: graphs et rushs
Diffstat (limited to 'graphs/cpp/cartesian_vector/state_saver.hh')
| -rw-r--r-- | graphs/cpp/cartesian_vector/state_saver.hh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/graphs/cpp/cartesian_vector/state_saver.hh b/graphs/cpp/cartesian_vector/state_saver.hh new file mode 100644 index 0000000..f52127c --- /dev/null +++ b/graphs/cpp/cartesian_vector/state_saver.hh @@ -0,0 +1,20 @@ +#pragma once + +#include <iostream> + +class StateSaver +{ +public: + //! constructor should save all flags and precision + StateSaver(std::ostream& os); + //! destructor should restore all flags and precision + ~StateSaver(); + +private: + //! original stream + std::ostream& saved_stream_; + //! flags of the original stream + std::ios_base::fmtflags saved_flags_; + //! precision of the original stream + std::streamsize saved_precision_; +}; |
