Title
tuple_element_t<1, const span<int, 42>> is const int
Status
new
Section
[span.tuple]
Submitter
Tim Song

Created on 2019-05-31.00:00:00, last changed 2019-06-08.16:31:03.

Messages

Date: 2019-06-08.16:31:03

Proposed resolution:

This wording is relative to N4810.

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

    […]
    // [span.tuple], tuple interface
    template<class T> class tuple_size;
    template<size_t I, class T> class tuple_element;
    template<class ElementType, size_t Extent>
      struct tuple_size<span<ElementType, Extent>>;
    template<class ElementType>
      struct tuple_size<span<ElementType, dynamic_extent>>; // not defined
    template<size_t I, class ElementType, size_t Extent>
      struct tuple_element<I, span<ElementType, Extent>>;
    template<size_t I, class ElementType, size_t Extent>
      struct tuple_element<I, const span<ElementType, Extent>>;
    template<size_t I, class ElementType, size_t Extent>
      struct tuple_element<I, volatile span<ElementType, Extent>>;
    template<size_t I, class ElementType, size_t Extent>
      struct tuple_element<I, const volatile span<ElementType, Extent>>;
    […]
    
  2. Modify [span.tuple] before p1 as indicated:

    [Drafting note: The representation style for the newly added wording follows the new style for tuple_element<I, span<ElementType, Extent>>::type, which had recently been changed editorially.]

    template<class ElementType, size_t Extent>
      struct tuple_size<span<ElementType, Extent>>
        : integral_constant<size_t, Extent> { };
    
    tuple_element<I, span<ElementType, Extent>>::type
    
    template<size_t I, class ElementType, size_t Extent>
      struct tuple_element<I, const span<ElementType, Extent>> {
        using type = ElementType;
      };
    
    template<size_t I, class ElementType, size_t Extent>
      struct tuple_element<I, volatile span<ElementType, Extent>> {
        using type = ElementType;
      };
    
    template<size_t I, class ElementType, size_t Extent>
      struct tuple_element<I, const volatile span<ElementType, Extent>> {
        using type = ElementType;
      };
    

    -1- Mandates: Extent != dynamic_extent && I < Extent is true.

Date: 2019-05-31.00:00:00

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

History
Date User Action Args
2019-06-08 16:31:03adminsetmessages: + msg10424
2019-05-31 00:00:00admincreate