• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // <sstream>
11 
12 // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
13 // class basic_stringstream
14 
15 // explicit basic_stringstream(ios_base::openmode which = ios_base::out|ios_base::in);
16 
17 #include <sstream>
18 #include <cassert>
19 
main()20 int main()
21 {
22     {
23         std::stringstream ss;
24         assert(ss.rdbuf() != 0);
25         assert(ss.good());
26         assert(ss.str() == "");
27     }
28     {
29         std::stringstream ss(std::ios_base::in);
30         assert(ss.rdbuf() != 0);
31         assert(ss.good());
32         assert(ss.str() == "");
33     }
34     {
35         std::wstringstream ss;
36         assert(ss.rdbuf() != 0);
37         assert(ss.good());
38         assert(ss.str() == L"");
39     }
40     {
41         std::wstringstream ss(std::ios_base::in);
42         assert(ss.rdbuf() != 0);
43         assert(ss.good());
44         assert(ss.str() == L"");
45     }
46 }
47