Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
27.stringbuf.overflow.stdcxx-149.cpp
Go to the documentation of this file.
1
29#include <cassert>
30#include <sstream>
31
32int 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}
#define buf
Definition 17.names.cpp:452
#define assert(expr)
Definition _cassert.h:40