Re: [Boost-bugs] [Boost C++ Libraries] #10514: Cannot copy const sub_range to non-const

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10514: Cannot copy const sub_range to non-const
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-02-02 02:27:40

#10514: Cannot copy const sub_range to non-const
  Reporter: Braden McDaniel <braden@…> | Owner: neilgroves
      Type: Bugs | Status: reopened
 Milestone: To Be Determined | Component: range
   Version: Boost 1.56.0 | Severity: Regression
Resolution: | Keywords:
Changes (by Braden McDaniel <braden@…>):

 * status: closed => reopened
 * resolution: invalid =>


 Replying to [comment:1 neilgroves]:
> The propagation of const-ness is the rationale for having sub_range in
 addition to iterator_range. Please see:
> If you do not wish to propagate const-ness please use iterator_range

 It appears to me that `const` is being propagating incorrectly in this
 case. At the very least, `const` is being propagated in a way that is
 inconsistent with how it is normally propagated with the standard
 containers. Consider the analogous example using just `std::vector`:
 std::vector<int> v(10);
 const std::vector<int> & v_ref = v;
 std::vector<int> u = v_ref;
 This compiles just fine because there is no problem copying a `const int`
 to an `int`. To the point: it doesn't matter that `v_ref` uses

 (So, I may have framed the problem incorrectly in my initial description.
 The problem isn't that `const_iterator`s are being used at all; the
 problem is that `sub_range` seems to insist that the lhs use
 `const_iterator`s just because the rhs does.)

Ticket URL: <>
Boost C++ Libraries <>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC