Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9287: Additional string_ref constructors
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-05-12 00:57:48
#9287: Additional string_ref constructors
-------------------------------+----------------------------
Reporter: psiha | Owner: marshall
Type: Feature Requests | Status: assigned
Milestone: To Be Determined | Component: utility
Version: Boost 1.54.0 | Severity: Not Applicable
Resolution: | Keywords:
-------------------------------+----------------------------
Comment (by vladimir.krivopalov@â¦):
Hi,
It seems that string_ref really lacks these constructors as cannot work
with boost::algorithm::split (a widely used one) without them although
std::string which boost::string_ref aims to substitute in such cases fits
the requirements of this algorithm perfectly.
You're right about that pair of iterators doesn't necessarily point to a
contiguous storage, but this may be a requirement for this constructor to
follow. Consider the existing constructor:
string_ref(CharT* str);
it crashes if you pass NULL/nullptr to it, so assumes that the input
parameter is non-NULL.
But this is not enforced (although here it is even possible to check
that).
The same could apply for the range-based constructor which would allow for
range-based algorithms to chime in.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9287#comment:4> 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:18 UTC