--82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable
Pavel, On Tue, Nov 05, 2002 at 10:55:36AM +0100, Pavel Tsekov wrote: > On Mon, 4 Nov 2002, Max Bowsher wrote: > > >> Jason Tishler <[EMAIL PROTECTED]> wrote: > > >>> What about the attached? > > >>> Note that I only tested setup.exe under Cygwin gcc 2.95.3-5 but > > >>> I also tried something similar under Linux gcc 3.x. > > > > > On Mon, Nov 04, 2002 at 08:05:08PM -0000, Max Bowsher wrote: > > >> Inlined: > > >> -LogSingleton::LogSingleton(){} > > >> +LogSingleton::LogSingleton() : ostream(rdbuf()){} > > >> > > >> Certainly looks less hackish than mine. >=20 > But doesn't make any sense. Why call rdbuf() when it just returns the > internal streambuf pointer i.e. the one which you want to set. I was concerned about the semantics myself, but I tried it out and it seemed to work. However, I just realized one of my mistakes. I thought that ostream contained a streambuf via inheritance from ios. Upon rereading basic_ios.h, I just noticed that the "streambuf" is really a "streambuf*". > IMO, it is good to use ostream (NULL) here and in each of the > LogSingleton heirs' constructors to do rdbuf (new somestreambuf). My second mistake was not reading LogFile.cc yesterday. So, I agree that the above is the way to go if one wants to minimize changes. However, it would be nice if LogSingleton could maintain a streambuf that all derived classes could reuse. Sorry for the noise. Jason --=20 GPG key available on key servers or http://www.tishler.net/jason/gpg.txt --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (Cygwin32) iD8DBQE9x8k1Gv3kzOz0jvYRAu+VAJ9UKpskSxqaTHdqdNQBG8YcCCb0BwCfY/rO A01b9Ei9S2yKIgEdkHBY2os= =3PsY -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs--