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