diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-06-22 10:06:39 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-06-22 10:06:39 +0000 |
commit | 40ab8eeaff1a32bce9da1390aaaff4bd1dac8547 (patch) | |
tree | 5f2d938ba07c066da1ee25f22e88ae358b32679f /libstdc++-v3/include/std/std_istream.h | |
parent | 926fe9d29fca8ed2108dfec96533c550bbe4700d (diff) | |
download | ppe42-gcc-40ab8eeaff1a32bce9da1390aaaff4bd1dac8547.tar.gz ppe42-gcc-40ab8eeaff1a32bce9da1390aaaff4bd1dac8547.zip |
2004-06-22 Paolo Carlini <pcarlini@suse.de>
* 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
Diffstat (limited to 'libstdc++-v3/include/std/std_istream.h')
-rw-r--r-- | libstdc++-v3/include/std/std_istream.h | 15 |
1 files changed, 13 insertions, 2 deletions
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 |