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
27.stringbuf.overflow.stdcxx-149.cpp
Go to the documentation of this file.
1
29
#include <cassert>
30
#include <sstream>
31
32
int
main
()
33
{
34
// Exercise the implementation of the resolution of LWG issue 432:
35
// http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#432
36
37
struct
MyBuf
: std::stringbuf {
38
using
std::stringbuf::eback;
39
using
std::stringbuf::egptr;
40
using
std::stringbuf::pbase;
41
using
std::stringbuf::pptr;
42
using
std::stringbuf::epptr;
43
using
std::stringbuf::overflow;
44
}
buf
;
45
46
buf
.overflow (
'x'
);
47
48
const
int
write_positions = int (
buf
.epptr () -
buf
.pbase ());
49
50
const
int
pass
= 1 < write_positions;
51
52
assert
(
pass
);
53
54
return
1 -
pass
;
55
}
buf
#define buf
Definition
17.names.cpp:452
pass
bool pass
Definition
26.valarray.transcend.stdcxx-315.cpp:41
main
int main()
Definition
27.stringbuf.overflow.stdcxx-149.cpp:32
assert
#define assert(expr)
Definition
_cassert.h:40
MyBuf
Definition
27.ostream.unformatted.stdcxx-626.cpp:35
Generated by
1.9.8