Re: [Boost-bugs] [Boost C++ Libraries] #8267: lexical_cast uses stream buffers incorrectly

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8267: lexical_cast uses stream buffers incorrectly
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-03-16 17:22:57


#8267: lexical_cast uses stream buffers incorrectly
--------------------------------------+-------------------------------------
  Reporter: johnmaddock | Owner: apolukhin
      Type: Bugs | Status: assigned
 Milestone: To Be Determined | Component: lexical_cast
   Version: Boost Development Trunk | Severity: Showstopper
Resolution: | Keywords:
--------------------------------------+-------------------------------------

Comment (by anonymous):

 I'm happy to move to boost/detail, but looking around I see the iostreams
 lib has the same functionality, just tried this:

 {{{
 #include <boost/iostreams/stream_buffer.hpp>
 #include <boost/iostreams/device/array.hpp>

 int main()
 {
    namespace io = boost::iostreams;

    const char* buf = "12345.6789";

    io::stream_buffer<io::array_source> sb(buf, buf + std::strlen(buf));
    std::istream is(&sb);

    double d;
    is >> d;

    std::cout << d << std::endl;

    assert(is.rdbuf()->in_avail() == 0);

    return 0;
 }
 }}}

 Is that a better bet?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8267#comment:2>
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:12 UTC