Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why won't my derived flush work?

Name: Anonymous 2007-03-23 22:09 ID:HKvm8kzy

Hey, I'm trying to create a class that's derived from ostringstream. So, it's like this:

class Message2:public ostringstream {
public:
    Message2 *flush();
};

My flush command does some special stuff, but the problem is it's never called! I've tried setting unitbuf (message << unitbuf; - is that the right way?), but that doesn't improve anything. Ending my streams with endl or flush doesn't call it either. So what's going on here?

Name: Anonymous 2007-03-23 22:26 ID:HEGPlAzY

I don't know C++ (it fails), but maybe it has something to do with virtual methods (or rather not being virtual)?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List