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-exception
6//
7//===----------------------------------------------------------------------===//
8
9// <iterator>
10
11// class ostream_iterator
12
13// ostream_iterator(const ostream_iterator& x);
14
15#include <iterator>
16#include <sstream>
17#include <cassert>
18
19#include "test_macros.h"
20
21int main(int, char**)
22{
23 std::ostringstream outf;
24 std::ostream_iterator<int> i(outf);
25 std::ostream_iterator<int> j = i;
26 assert(outf.good());
27 ((void)j);
28
29 return 0;
30}
31

source code of libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.cons.des/copy.pass.cpp