Topic: Inconsistent (re)declarations of virtual functions
Author: dsp@bdal.de (Daniel Spangenberg)
Date: Mon, 21 Jul 2003 18:32:58 +0000 (UTC) Raw View
Hello!
During the weekend I stumbled about some inconsistencies of
(re)declarations of virtual functions in our current standard.
Sometimes these declarations provide the "virtual" specifier,
sometimes not.
The most obvious inconsistency I found in Section 22.2.1.3.4
[lib.facet.ctype.char.virtuals]:
char do_toupper(char) const;
const char* do_toupper(char* low, const char* high) const;
char do_tolower(char) const;
const char* do_tolower(char* low, const char* high) const;
virtual char do_widen(char c) const;
virtual const char* do_widen(const char* low, const char* high, char*
to) const;
virtual char do_narrow(char c, char dfault) const;
virtual const char* do_narrow(const char* low,const char* high,char
dfault, char* to) const;
where the do_toupper and do_tolower functions don't have the
virtual specifier, while the do_widen and the do_narrow functions have.
I think, a somewhat more consistent scheme would make these declarations
much more intuitively understandable. Obiously, the largest part of the
standard
omits these specifiers in redeclarations, so one should either omit them
in the given
example for the do_widen and do_narrow functions or should add them to
all the others.
Yours,
Daniel Spangenberg
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]