Home | History | Annotate | Download | only in unique.ptr.special
      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 // UNSUPPORTED: c++98, c++03
     11 //  Because we don't have a functioning decltype in C++03
     12 
     13 // <memory>
     14 
     15 // unique_ptr
     16 
     17 // template<class CharT, class Traits, class Y, class D>
     18 //   basic_ostream<CharT, Traits>&
     19 //   operator<<(basic_ostream<CharT, Traits>& os, const unique_ptr<Y, D>& p);
     20 
     21 //   -?- Remarks: This function shall not participate in overload resolution unless os << p.get() is a valid expression.
     22 
     23 #include <memory>
     24 #include <sstream>
     25 #include <cassert>
     26 
     27 class A {};
     28 
     29 int main()
     30 {
     31     std::unique_ptr<A> p(new A);
     32     std::ostringstream os;
     33     os << p;
     34 }
     35