This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/14021] lacking conversion from `std::streampos' to `std::streamoff'
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Feb 2004 22:51:05 -0000
- Subject: [Bug libstdc++/14021] lacking conversion from `std::streampos' to `std::streamoff'
- References: <20040204215243.14021.krempp@crans.ens-cachan.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pcarlini at suse dot de 2004-02-04 22:51 -------
This behavior is intended, and it's our best interpretation of table 88,
actually. In postypes.h (new in 3.4) you can find this comment:
// The standard requires that streamoff can be constructed from
// instances of fpos using the constructor syntax, but gives no
// semantics for this construction. In this implementation it
// extracts the offset stored by the fpos object.
// Note: In versions of GCC up to and including GCC 3.3, implicit
// conversion from fpos to streamoff was allowed. This constructor
// has now been made explicit to improve type safety.
template<typename _StateT>
explicit
streamoff(const fpos<_StateT>&);
Indeed
std::streamoff off(std::streampos(0));
works.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |pcarlini at suse dot de
|dot org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14021