[Q] Problem with derived from streambuf class
Paolo Carlini
pcarlini@suse.de
Sat Oct 16 19:01:00 GMT 2004
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.
More information about the Libstdc++
mailing list