2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-19 10:08:04 +03:00
rehlds/rehlds/public/iosutil.h
2015-06-27 14:06:45 +04:00

22 lines
366 B
C++

#pragma once
#include <ios>
class IosFlagSaver {
public:
explicit IosFlagSaver(std::ostream& _ios) :
ios(_ios),
f(_ios.flags()) {
}
~IosFlagSaver() {
ios.flags(f);
}
IosFlagSaver(const IosFlagSaver &rhs) = delete;
IosFlagSaver& operator= (const IosFlagSaver& rhs) = delete;
private:
std::ostream& ios;
std::ios::fmtflags f;
};