Date
2020-02-14.16:06:37
Message id
11085

Content

As currently specified, it uses the cv-qualified partial specialization, which incorrectly adds cv-qualification to the element type.

Previous resolution [SUPERSEDED]:

This wording is relative to N4849.

  1. Modify [ranges.syn], header <ranges> synopsis, as indicated:

    […]
    namespace std {
      namespace views = ranges::views;
    
      template<class I, class S, ranges::subrange_kind K>
      struct tuple_size<ranges::subrange<I, S, K>>
        : integral_constant<size_t, 2> {};
      template<class I, class S, ranges::subrange_kind K>
      struct tuple_element<0, ranges::subrange<I, S, K>> {
        using type = I;
      };
      template<class I, class S, ranges::subrange_kind K>
      struct tuple_element<1, ranges::subrange<I, S, K>> {
        using type = S;
      };
      template<class I, class S, ranges::subrange_kind K>
      struct tuple_element<0, const ranges::subrange<I, S, K>> {
        using type = I;
      };
      template<class I, class S, ranges::subrange_kind K>
      struct tuple_element<1, const ranges::subrange<I, S, K>> {
        using type = S;
      };
    }
    
  2. Add the following wording to Annex D:

    D.? Deprecated subrange tuple interface [depr.ranges.syn]

    1 The header <ranges> ([ranges.syn]) has the following additions:

    namespace std {
      template<size_t X, class I, class S, ranges::subrange_kind K>
      struct tuple_element<X, volatile ranges::subrange<I, S, K>> {};
      template<size_t X, class I, class S, ranges::subrange_kind K>
      struct tuple_element<X, const volatile ranges::subrange<I, S, K>> {};
    }