This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Q] Problem with derived from streambuf class
- From: Paolo Carlini <pcarlini at suse dot de>
- To: zaufi at sendmail dot ru
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Sat, 16 Oct 2004 20:59:10 +0200
- Subject: Re: [Q] Problem with derived from streambuf class
- References: <200410162126.26659.zaufi@sendmail.ru>
Hi,
zaufi@sendmail.ru wrote:
3) ostream::put() calls NON VIRTUAL function base_streambuf::sputc() !! -- so
there is no way to redefine it in derived classes... :(((
Maybe I'm missing some details (I will read again your message
later), but, if this is your main point, there is little doubt
that, according to the ISO standard that we are implementing,
this is right behavior. See 27.6.2.1/2, in particular:
"... Both groups of output functions generate (or _insert_)
output characters by actions equivalent to calling
rdbuf->sputc(int_type). They may use other public members of
basic_ostream except that they do not invoke any virtual
members of rdbuf() except overflow()."
Paolo.