// C++ Builder 6.0 bug using new STL // Following program works when linked with dynamic RTL // but throws EAccessViolation linked with static RTL // Vesa Lappalainen 24.3.2002 // vesal@mit.jyu.fi //#define _USE_OLD_RW_STL // Works if this is defined #include class dstreambuf : public std::streambuf { public: int overflow(int c) { std::cout << c; return 0; } dstreambuf() : std::streambuf() { } }; dstreambuf dbuf; std::ostream dout(&dbuf); int main(void) { dout << "Hello World!\n"; return 0; } //---------------------------------------------------------------------------