lattanzi@decwrl.dec.com (Len Lattanzi) (01/16/91)
// Given the following 2.0 C++ #include <iostream.h> static class MyIostream_init { static int count; static Iostream_init *io; public: MyIostream_init(); ~MyIostream_init(); }; static MyIostream_init init; static int idx; MyIostream_init::MyIostream_init() { if (count++ > 0) return; io = new Iostream_init; idx = ios::xalloc(); } MyIostream_init::~MyIostream_init() { if (--count > 0) return; delete io; } main() { cerr.iword(idx) = 1; clog.iword(idx) = 0; clog = cerr; cout << clog.iword(idx) << endl; // I expected '1' to be printed out. Glockenspiel 2.0 gave me '0', the // work-around is tedious and without an 'official' iostream // specification I'm not sure if this is a bug or feature. // Submitted for your input. } \ Len Lattanzi (Migration Software Systems Ltd 408 452 0527) <len@migration.com>