[Boost-bugs] [Boost C++ Libraries] #5139: Initial Stream Position in Boost.Interprocess.Vectorstream

Subject: [Boost-bugs] [Boost C++ Libraries] #5139: Initial Stream Position in Boost.Interprocess.Vectorstream
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-01-29 13:04:46


#5139: Initial Stream Position in Boost.Interprocess.Vectorstream
--------------------------------+-------------------------------------------
 Reporter: charles@… | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: interprocess
  Version: Boost 1.45.0 | Severity: Problem
 Keywords: |
--------------------------------+-------------------------------------------
 When the boost::interprocess::basic_vectorstream<T> is default-
 constructed, tellp() initially returns an invalid stream position.
 Presumably, it should return position 0 before anything is inserted into
 the stream, but instead it returns -1.

 This is easy to reproduce:

 {{{
 #!div style="font-size: 100%"
 Code highlighting:
   {{{#!C++
 #include <sstream>
 #include <boost/interprocess/streams/vectorstream.hpp>

 int main()
 {
         std::stringstream ss;
         std::cout << ss.tellp() << " ";

         boost::interprocess::basic_vectorstream<std::vector<char> > vs;
         std::cout << vs.tellp() << std::endl;
 }
   }}}
 }}}

 This should output:
 0 -1

 In contrast with std::stringstream, we see that
 boost::interprocess::basic_vectorstream begins with an invalid stream
 position. It should begin at 0, but it begins at -1.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5139>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC