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 ostreambuf_iterator
12
13// ostreambuf_iterator(ostream_type& s) throw();
14
15#include <iterator>
16#include <sstream>
17#include <cassert>
18
19#include "test_macros.h"
20
21int main(int, char**)
22{
23 {
24 std::ostringstream outf;
25 std::ostreambuf_iterator<char> i(outf);
26 assert(!i.failed());
27 }
28#ifndef TEST_HAS_NO_WIDE_CHARACTERS
29 {
30 std::wostringstream outf;
31 std::ostreambuf_iterator<wchar_t> i(outf);
32 assert(!i.failed());
33 }
34#endif
35
36 return 0;
37}
38

source code of libcxx/test/std/iterators/stream.iterators/ostreambuf.iterator/ostreambuf.iter.cons/ostream.pass.cpp