This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[RFC] Shall we provide 3 overloads for istream::ignore?
- From: Paolo Carlini <pcarlini at suse dot de>
- To: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 28 May 2004 11:12:30 +0200
- Subject: [RFC] Shall we provide 3 overloads for istream::ignore?
Hi,
according to 27.6.1.3, p24, the signature of istream::ignore is:
ignore(streamsize n = 1, int_type delim = traits::eof()) [1]
As often happens when defaults are involved, in this case too, providing,
additionally to
ignore(streamsize n, int_type delim) [2]
the overloads
ignore(streamsize n) [3]
and
ignore() [4]
should lead to much improved performance: [4] would be obviously trivial,
no loop involved; [3] may take into account that delim is traits::eof(),
and then no delim at all would be searched in the buffer.
Therefore, may question: is there anything wrong with providing those
overloads? What about the ABI? Is it completely safe providing [2], [3] and
[4] instead of simply [1]?
Thanks,
Paolo.