xref: /llvm-project/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.special/io.pass.cpp (revision 48f365399936d6ecb38f57f4cf72a870896d954d)
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 // <memory>
11 
12 // unique_ptr
13 
14 // template<class CharT, class Traits, class Y, class D>
15 //   basic_ostream<CharT, Traits>&
16 //   operator<<(basic_ostream<CharT, Traits>& os, const unique_ptr<Y, D>& p);
17 
18 #include <memory>
19 #include <sstream>
20 #include <cassert>
21 
22 int main()
23 {
24     std::unique_ptr<int> p(new int(3));
25     std::ostringstream os;
26     assert(os.str().empty());
27     os << p;
28     assert(!os.str().empty());
29 }
30