2
0
mirror of https://github.com/rehlds/metamod-r.git synced 2025-01-09 13:35:47 +03:00
metamod-r/metamod/extra/example/include/hlsdk/public/iosutil.h

22 lines
345 B
C
Raw Normal View History

2017-03-10 18:38:35 +03:00
#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;
};