brintos

brintos / llvm-project-archived public Read only

0
0
Text · 946 B · 68c9a27 Raw
38 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: c++0310//  Because we don't have a functioning decltype in C++0311 12// UNSUPPORTED: no-localization13 14// <memory>15 16// unique_ptr17 18// template<class CharT, class Traits, class Y, class D>19//   basic_ostream<CharT, Traits>&20//   operator<<(basic_ostream<CharT, Traits>& os, const unique_ptr<Y, D>& p);21 22#include <memory>23#include <sstream>24#include <cassert>25 26#include "test_macros.h"27 28int main(int, char**)29{30    std::unique_ptr<int> p(new int(3));31    std::ostringstream os;32    assert(os.str().empty());33    os << p;34    assert(!os.str().empty());35 36  return 0;37}38