1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // <iomanip>
11 
12 // T1 resetiosflags(ios_base::fmtflags mask);
13 
14 #include <iomanip>
15 #include <cassert>
16 
17 template <class CharT>
18 struct testbuf
19     : public std::basic_streambuf<CharT>
20 {
testbuftestbuf21     testbuf() {}
22 };
23 
main()24 int main()
25 {
26     {
27         testbuf<char> sb;
28         std::istream is(&sb);
29         assert(is.flags() & std::ios_base::skipws);
30         is >> std::resetiosflags(std::ios_base::skipws);
31         assert(!(is.flags() & std::ios_base::skipws));
32     }
33     {
34         testbuf<char> sb;
35         std::ostream os(&sb);
36         assert(os.flags() & std::ios_base::skipws);
37         os << std::resetiosflags(std::ios_base::skipws);
38         assert(!(os.flags() & std::ios_base::skipws));
39     }
40     {
41         testbuf<wchar_t> sb;
42         std::wistream is(&sb);
43         assert(is.flags() & std::ios_base::skipws);
44         is >> std::resetiosflags(std::ios_base::skipws);
45         assert(!(is.flags() & std::ios_base::skipws));
46     }
47     {
48         testbuf<wchar_t> sb;
49         std::wostream os(&sb);
50         assert(os.flags() & std::ios_base::skipws);
51         os << std::resetiosflags(std::ios_base::skipws);
52         assert(!(os.flags() & std::ios_base::skipws));
53     }
54 }
55