From 40ab8eeaff1a32bce9da1390aaaff4bd1dac8547 Mon Sep 17 00:00:00 2001 From: paolo Date: Tue, 22 Jun 2004 10:06:39 +0000 Subject: 2004-06-22 Paolo Carlini * include/std/std_istream.h (ignore(streamsize __n = 1, int_type __delim = traits_type::eof())): Split into... (ignore(), ignore(streamsize __n), ignore(streamsize __n, int_type __delim)): The first two can be much more simpler and efficient than the fully general case; also, the last two can take advantage of the same mechanism already used for getline. * include/bits/istream.tcc (ignore(streamsize __n = 1, int_type __delim = traits_type::eof()): Remove. (ignore(), ignore(streamsize __n), ignore(streamsize __n, int_type __delim)): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83486 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/include/std/std_istream.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'libstdc++-v3/include/std/std_istream.h') diff --git a/libstdc++-v3/include/std/std_istream.h b/libstdc++-v3/include/std/std_istream.h index a3a53ba73f6..65f9e6c3034 100644 --- a/libstdc++-v3/include/std/std_istream.h +++ b/libstdc++-v3/include/std/std_istream.h @@ -1,6 +1,6 @@ // Input streams -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003 +// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003, 2004 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -412,9 +412,20 @@ namespace std * - the next character equals @a delim (in this case, the character * is extracted); note that this condition will never occur if * @a delim equals @c traits::eof(). + * + * NB: Provide three overloads, instead of the single function + * (with defaults) mandated by the Standard: this leads to a + * better performing implementation, while still conforming to + * the Standard. */ __istream_type& - ignore(streamsize __n = 1, int_type __delim = traits_type::eof()); + ignore(); + + __istream_type& + ignore(streamsize __n); + + __istream_type& + ignore(streamsize __n, int_type __delim); /** * @brief Looking ahead in the stream -- cgit v1.2.1