blob: f52127c0bcf535a5cf5ae8ef91ace13aebc315da (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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_;
};
|