This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/14021] lacking conversion from `std::streampos' to `std::streamoff'


------- 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


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