Title
elements_view::iterator befriends a specialization of itself
Status
c++20
Section
[range.elements.iterator]
Submitter
Casey Carter

Created on 2020-01-18.00:00:00 last changed 37 months ago

Messages

Date: 2020-02-08.12:11:39

Proposed resolution:

This wording is relative to N4842.

  1. Modify [range.elements.iterator], class template elements_view::iterator synopsis, as indicated:

    namespace std::ranges {
      template<class V, size_t N>
      template<bool Const>
      class elements_view<V, N>::iterator { // exposition only
        using base_t = conditional_t<Const, const V, V>;
        friend iterator<!Const>;
    
        iterator_t<base_t> current_;
      public:
        […]
      };
      […]
    }
    
Date: 2020-02-08.00:00:00

[ 2020-02-08 Status set to Tentatively Ready after ten positive votes on the reflector. ]

Date: 2020-01-18.00:00:00

The synopsis of the exposition-only class template elements_view::iterator in [range.elements.iterator] includes the declaration "friend iterator<!Const>;". We typically don't depict such friend relationships in the Library specification, leaving the choice of how to implement access to private data from external sources to implementer magic. For consistency, we should strike this occurrence from elements_view::iterator.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2020-02-24 16:02:59adminsetstatus: immediate -> wp
2020-02-14 06:37:09adminsetstatus: ready -> immediate
2020-02-08 12:11:39adminsetmessages: + msg10990
2020-02-08 12:11:39adminsetstatus: new -> ready
2020-01-19 13:52:37adminsetmessages: + msg10954
2020-01-18 00:00:00admincreate