Calculator Step 6

- Main Page
- Classes
- Files

- File List
- File Members

ioflags.hpp
Go to the documentation of this file.
1 #ifndef IOFLAGS_HPP_
2 #define IOFLAGS_HPP_
3
15 class ioflags
16 {
17 public:
20 ioflags(std::basic_ios<char>& stream) : stream_(stream), flags_{stream.flags()} {}
22 ~ioflags() { stream_.flags(flags_); }
23 private:
24 std::basic_ios<char>& stream_;
25 std::ios_base::fmtflags flags_;
26 };
27
28 #endif
ioflags::ioflags
ioflags(std::basic_ios< char > &stream)
Definition: ioflags.hpp:20
ioflags::flags_
std::ios_base::fmtflags flags_
Definition: ioflags.hpp:25
ioflags::stream_
std::basic_ios< char > & stream_
Definition: ioflags.hpp:24
ioflags
Definition: ioflags.hpp:15
ioflags::~ioflags
~ioflags()
Restore the formatting flags.
Definition: ioflags.hpp:22