Re: [Boost-bugs] [Boost C++ Libraries] #10493: Since 1.56, any_range with non-reference references can cause UB

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10493: Since 1.56, any_range with non-reference references can cause UB
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-04-27 12:50:24


#10493: Since 1.56, any_range with non-reference references can cause UB
---------------------------+------------------------
  Reporter: nofitserov@… | Owner: neilgroves
      Type: Bugs | Status: assigned
 Milestone: Boost 1.58.0 | Component: range
   Version: Boost 1.56.0 | Severity: Regression
Resolution: | Keywords:
---------------------------+------------------------

Comment (by anonymous):

 Just reproduced it with boost 1.58 after migration from 1.55.
 I tried to play with it and found how to make it work.

 Using const std::string instead of std::string, seems fix the problem

 {{{
 typedef boost::any_range<
     std::string,
     boost::forward_traversal_tag,
     const std::string,
     std::ptrdiff_t
> range_t;
 }}}

 I haven't digged into any_iterator sources but seems it behave differently
 when Reference is const

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10493#comment:3>
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