Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6160: support for (istream >> array < char >)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-11-22 10:19:51
#6160: support for (istream >> array < char >)
------------------------------------+---------------------------------------
Reporter: giecrilj@⦠| Owner: marshall
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: array
Version: Boost 1.44.0 | Severity: Cosmetic
Resolution: | Keywords:
------------------------------------+---------------------------------------
Comment (by ne01026@â¦):
Replying to [comment:1 cornedbee]:
> > the standard library provides the syntax (istream >> char []) and
(ostream << char const [])
>
> No, it provides istream >> char* and ostream << char const*. As such,
you can quite easily use the c_array() and data() members to get pointers
to the data: istream >> ar.c_array() and ostream << ar.data().
The call ~~`istream >> ar.c_array ()`~~ invites buffer overflow and
undefined behaviour. If it were that simple, I would not bother writing
so many words here.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6160#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:07 UTC