1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
11 // class ostreambuf_iterator
13 // bool failed() const throw();
19 #include "test_macros.h"
21 template <typename Char
, typename Traits
= std::char_traits
<Char
> >
22 struct my_streambuf
: public std::basic_streambuf
<Char
,Traits
> {
23 typedef typename
std::basic_streambuf
<Char
,Traits
>::int_type int_type
;
24 typedef typename
std::basic_streambuf
<Char
,Traits
>::char_type char_type
;
27 int_type
sputc(char_type
) { return Traits::eof(); }
33 my_streambuf
<char> buf
;
34 std::ostreambuf_iterator
<char> i(&buf
);
38 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
40 my_streambuf
<wchar_t> buf
;
41 std::ostreambuf_iterator
<wchar_t> i(&buf
);