blob: 1f088df19c1a7a0d15ab03dc9c929cfcfd2581c2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
//===----------------------------------------------------------------------===//
//
// ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊThe LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <iterator>
// template<class charT, class traits = char_traits<charT> >
// class istreambuf_iterator
// : public iterator<input_iterator_tag, charT,
// typename traits::off_type, charT*,
// charT>
// {
// public:
// ...
// proxy operator++(int);
// class proxy
// {
// public:
// charT operator*();
// };
#include <iterator>
#include <sstream>
#include <cassert>
int main()
{
{
std::istringstream inf("abc");
std::istreambuf_iterator<char> i(inf);
assert(*i++ == 'a');
}
{
std::wistringstream inf(L"abc");
std::istreambuf_iterator<wchar_t> i(inf);
assert(*i++ == L'a');
}
}
|