3144. span does not have a const_pointer typedef

Section: 23.7.2.2.1 [span.overview] Status: C++20 Submitter: Louis Dionne Opened: 2018-07-23 Last modified: 2021-02-25

Priority: 0

View all other issues in [span.overview].

View all issues with C++20 status.

Discussion:

std::span does not have a typedef for const_pointer and const_reference. According to Marshall Clow, this is merely an oversight.

[2019-01-20 Reflector prioritization]

Set Priority to 0 and status to Tentatively Ready

Proposed resolution:

This wording is relative to N4750.

  1. Change 23.7.2.2.1 [span.overview], class template span synopsis, as indicated:

    namespace std {
      template<class ElementType, ptrdiff_t Extent = dynamic_extent>
      class span {
      public:
        // constants and types
        using element_type = ElementType;
        using value_type = remove_cv_t<ElementType>;
        using index_type = ptrdiff_t;
        using difference_type = ptrdiff_t;
        using pointer = element_type*;
        using const_pointer = const element_type*;
        using reference = element_type&;
        using const_reference = const element_type&;
        using iterator = implementation-defined;
        using const_iterator = implementation-defined;
        using reverse_iterator = reverse_iterator<iterator>;
        using const_reverse_iterator = reverse_iterator<const_iterator>;
        static constexpr index_type extent = Extent;
      
        […]
      };
      […]
    }