Title
join_view<V>::iterator<true> tries to write through const join_view ptr
Status
resolved
Section
[range.join.view]
Submitter
Eric Niebler

Created on 2019-09-09.00:00:00 last changed 43 months ago

Messages

Date: 2020-08-21.20:53:46

Proposed resolution:

This wording is relative to N4830.

  1. Modify [range.join.view], class template join_view synopsis, as indicated:

    [Drafting note: Changing the join_view<V>::inner_ member to be mutable is safe because this exposition-only member is only used when the join_view is single-pass and only modified by operations that invalidate other iterators]

    namespace std::ranges {
      template<input_range V>
        requires view<V> && input_range<range_reference_t<V>>> &&
                (is_reference_v<range_reference_t<V>> ||
                view<range_value_t<V>>)
      class join_view : public view_interface<join_view<V>> {
      private:
        […]
        V base_ = V(); // exposition only
        mutable all_view<InnerRng> inner_ = // exposition only, present only when 
                                            // !is_reference_v<InnerRng>
          all_view<InnerRng>();
      public:
        […]
      };
    }
    
Date: 2020-08-21.00:00:00

[ 2020-08-21 Issue processing telecon: resolved by P1983R0 §2.4. Status changed: New → Resolved. ]

Date: 2020-02-15.00:00:00

[ 2020-02-10, Prague ]

Would be resolved by P1983R0.

Date: 2019-10-07.02:21:30

[ 2019-10 Priority set to 2 after reflector discussion ]

Date: 2019-09-09.00:00:00

The non-const join_view::begin() returns iterator<simple-view<V>>. If simple-view<V> is true, then the iterator stores a const join_view* named parent_. iterator::satisfy() will try to write to parent_->inner_ if ref_is_glvalue is false. That doesn't work because the inner_ field is not marked mutable.

History
Date User Action Args
2020-08-21 20:53:46adminsetmessages: + msg11453
2020-08-21 20:53:46adminsetstatus: new -> resolved
2020-02-10 14:07:48adminsetmessages: + msg11010
2019-10-07 02:21:30adminsetmessages: + msg10681
2019-09-15 12:42:55adminsetmessages: + msg10627
2019-09-09 00:00:00admincreate