Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
File List
Globals
EXTERNAL_HEADERS
RSL
tests
regress
21.string.io.stdcxx-250.cpp
Go to the documentation of this file.
1
29
#include <cassert>
30
#include <istream>
31
#include <string>
32
33
int
main
()
34
{
35
struct
MyBuf
: std::streambuf {
36
int_type underflow () {
37
static
int
i
= 0;
38
// i == 0: sgect() invoked from sentry ctor
39
// i == 1: sgetc() invoked from operator>>()
40
// i == 2: sbumpc() invoked from operator>>()
41
return
1 <
i
++ ?
throw
i
:
'x'
;
42
}
43
}
buf
;
44
45
std::istream is (&
buf
);
46
47
std::string
s
;
48
is >>
s
;
49
50
assert
(
"x"
==
s
);
51
assert
((is.failbit | is.badbit) == is.rdstate ());
52
53
return
0;
54
}
i
#define i
Definition
17.names.cpp:126
buf
#define buf
Definition
17.names.cpp:452
s
#define s
Definition
rw_alg_test.h:221
main
int main()
Definition
21.string.io.stdcxx-250.cpp:33
assert
#define assert(expr)
Definition
_cassert.h:40
MyBuf
Definition
27.ostream.unformatted.stdcxx-626.cpp:35
Generated by
1.9.8