Project 2 - Fixed-Point Number Class
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 
24  ioflags(ioflags const&) = delete;
25  ioflags& operator=(ioflags const&) = delete;
26 
27 private:
28  std::basic_ios<char>& stream_;
29  std::ios_base::fmtflags flags_;
30 };
31 
32 #endif
ioflags(std::basic_ios< char > &stream)
Definition: ioflags.hpp:20
~ioflags()
Restore the formatting flags.
Definition: ioflags.hpp:22