Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2649: iterator_range's assignment fires an assert when rhs is singular
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-04-10 15:06:20
#2649: iterator_range's assignment fires an assert when rhs is singular
---------------------------------------+------------------------------------
Reporter: eyal.farago@⦠| Owner: neilgroves
Type: Bugs | Status: closed
Milestone: Boost 1.38.0 | Component: range
Version: Boost 1.36.0 | Severity: Regression
Resolution: fixed | Keywords: iterator_range
---------------------------------------+------------------------------------
Changes (by neilgroves):
* status: assigned => closed
* resolution: => fixed
Comment:
The submitted code should never have compiled since
iterator_range<std::string> is illegal.
The newly merged RangeEx into Range runs the following code without
assertion in debug, or crash in release.
I made the decision to remove the singularity concept from Boost.Range
entirely. It is my opinion that singularity is a property of iterators and
that it is not possible to usefully augment range to provide additional
safety without removing the capability to support valid use-cases.
#include <string>
#include <boost/range/iterator.hpp>
#include <boost/range/sub_range.hpp>
typedef boost::sub_range<std::string> str_range_t;
int main(int argc, const char* argv[])
{
std::string eyal("eyal");
str_range_t eyal_range( eyal ), empty_range;
eyal_range = empty_range;
return 0;
}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/2649#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:02 UTC