Andre Poenitz <[EMAIL PROTECTED]> writes: > > I see *what* you're doing. You're initializing the base class, passing > > its c-tor a std::basic_streambuf<char_type> pointer which you're also > > using to initialize the sbuf_ member variable. > > > > Is that safe? > > I believe it is safe. The TexStreamBuffer c'tor only stores the passed > pointer, it does not do anything else with it. This is certainly legal. > After that we have a new TexStreamBuffer object (pointer) which we store > in on a TexStream member variable (again, just pointer assignment). Only > _now_ the base class constuctor is called and constructs the base > 'slice' of the TexStream object. This should not touch the sbuf_ member > as this is not part of this 'slive'.
So there's no requirement that the base class must be initialized *before* the derived class' members? I guess that's what I felt uncomfortable with. As I said, it's been a long time and my brain is polluted with C# :-P > > Incidentally, am I correct to say that this class isn't being used in > > anger yet? > > Whatever 'anger' means in New English. "For real", I guess. > It's not used because it does not work (doesn't write anything). It used > to work as standalone solution with cout, but here we have some > complication due to docstream and fstream. Haven't had time to fix this. Ahhhh. Anyway, it was an interesting read. Always nice to see elegant solutions. Angus
