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 // template<class charT, class traits = char_traits<charT> > 12 // class istreambuf_iterator 13 // : public iterator<input_iterator_tag, charT, 14 // typename traits::off_type, charT*, 15 // charT> 16 // { 17 // public: 18 // ... 19 // proxy operator++(int); 20 21 // class proxy 22 // { 23 // public: 24 // charT operator*(); 25 // }; 26 27 #include <iterator> 28 #include <sstream> 29 #include <cassert> 30 31 #include "test_macros.h" 32 main(int,char **)33int main(int, char**) 34 { 35 { 36 std::istringstream inf("abc"); 37 std::istreambuf_iterator<char> i(inf); 38 assert(*i++ == 'a'); 39 } 40 { 41 std::wistringstream inf(L"abc"); 42 std::istreambuf_iterator<wchar_t> i(inf); 43 assert(*i++ == L'a'); 44 } 45 46 return 0; 47 } 48