xref: /llvm-project/libcxx/test/std/utilities/memory/unique.ptr/unique.ptr.special/io.pass.cpp (revision a7f9895cc18995549c7facb96e72718da282a864)
148f36539SMarshall Clow //===----------------------------------------------------------------------===//
248f36539SMarshall Clow //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
648f36539SMarshall Clow //
748f36539SMarshall Clow //===----------------------------------------------------------------------===//
848f36539SMarshall Clow 
931cbe0f2SLouis Dionne // UNSUPPORTED: c++03
101ea2f5e3SMarshall Clow //  Because we don't have a functioning decltype in C++03
111ea2f5e3SMarshall Clow 
12*a7f9895cSLouis Dionne // UNSUPPORTED: no-localization
1388ffc727SLouis Dionne 
1448f36539SMarshall Clow // <memory>
1548f36539SMarshall Clow 
1648f36539SMarshall Clow // unique_ptr
1748f36539SMarshall Clow 
1848f36539SMarshall Clow // template<class CharT, class Traits, class Y, class D>
1948f36539SMarshall Clow //   basic_ostream<CharT, Traits>&
2048f36539SMarshall Clow //   operator<<(basic_ostream<CharT, Traits>& os, const unique_ptr<Y, D>& p);
2148f36539SMarshall Clow 
2248f36539SMarshall Clow #include <memory>
2348f36539SMarshall Clow #include <sstream>
2448f36539SMarshall Clow #include <cassert>
2548f36539SMarshall Clow 
267fc6a556SMarshall Clow #include "test_macros.h"
277fc6a556SMarshall Clow 
main(int,char **)282df59c50SJF Bastien int main(int, char**)
2948f36539SMarshall Clow {
3048f36539SMarshall Clow     std::unique_ptr<int> p(new int(3));
3148f36539SMarshall Clow     std::ostringstream os;
3248f36539SMarshall Clow     assert(os.str().empty());
3348f36539SMarshall Clow     os << p;
3448f36539SMarshall Clow     assert(!os.str().empty());
352df59c50SJF Bastien 
362df59c50SJF Bastien   return 0;
3748f36539SMarshall Clow }
38