This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [libstdc++] Proposed patch for fstream.h
- To: Benjamin Kosnik <bkoz at redhat dot com>
- Subject: Re: [libstdc++] Proposed patch for fstream.h
- From: Peter Schmid <schmid at snake dot iap dot physik dot tu-darmstadt dot de>
- Date: Sat, 24 Mar 2001 02:03:17 +0100 (CET)
- cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
|hmm. streampos is not actually used:
|
| pos_type
| tellg(void);
|
| __istream_type&
| seekg(pos_type);
|
| __istream_type&
| seekg(off_type, ios_base::seekdir);
According to Josuttis "The C++ Standard Library" page 634 -- 636,
instead of std::ios::pos_type pos (= file.tellg()), I can also write
std::streampos pos.
Quote from Josuttis:
"Class fpos<> is used to define types streampos for char and
wstreampos for w_char_t streams. These types are used to define the
pos_type of the corresponding character traits. And the pos_type
member of the traits is used to define pos_type of the corresponding
stream classes. Thus, you could also use streampos as the type of the
stream positions".
Since old code (using the old iostream implementation, confer e.g.
the version of libstdc++ which is shipped with gcc-2.95.2)
defines streampos as return type for tellg, I propose to expose
streampos to the global namespace, if that makes sense.
Peter Schmid