This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [libstdc++] Proposed patch for fstream.h



|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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]