Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
27.filebuf.virtuals.stdcxx-522.cpp
Go to the documentation of this file.
1
29#include <cassert>
30#include <fstream>
31#include <ios>
32
33int main ()
34{
35 struct MyBuf : std::filebuf {
36 int_type overflow (int_type c) {
37 return std::filebuf::overflow (c);
38 }
39 } buf;
40
41 buf.open ("file", std::ios::out);
42 buf.pubsetbuf (0, 0);
43 buf.overflow (std::filebuf::traits_type::eof ());
44 buf.close ();
45
46 std::ifstream in ("file");
47 assert (std::istream::traits_type::eof () == in.get ());
48}
#define buf
Definition 17.names.cpp:452
#define c
Definition 17.names.cpp:111
const int in
#define assert(expr)
Definition _cassert.h:40