Title
has-arrow should required operator->() to be const-qualified
Status
wp
Section
[range.utility.helpers]
Submitter
Hewill Kang

Created on 2024-06-22.00:00:00 last changed 3 weeks ago

Messages

Date: 2024-11-28.21:40:31

Proposed resolution:

This wording is relative to N4981.

  1. Modify [range.utility.helpers] as indicated:

    […]
    
    template<class I>
      concept has-arrow =                                       // exposition only
        input_iterator<I> && (is_pointer_v<I> || requires(const I i) { i.operator->(); });
    
    […]
    
Date: 2024-11-28.21:40:31

[ Wrocław 2024-11-23; Status changed: Voting → WP. ]

Date: 2024-06-24.16:42:21

[ St. Louis 2024-06-24; move to Ready ]

Date: 2024-06-24.16:42:21

The helper concept has-arrow in [range.utility.helpers] does not require that I::operator->() be const-qualified, which is inconsistent with the constraints on reverse_iterator and common_iterator's operator->() as the latter two both require the underlying iterator has const operator->() member.

We should enhance the semantics of has-arrow so that implicit expression variations ([concepts.equality]) prohibit silly games.

History
Date User Action Args
2024-11-28 21:40:31adminsetmessages: + msg14482
2024-11-28 21:40:31adminsetstatus: voting -> wp
2024-11-19 16:09:07adminsetstatus: ready -> voting
2024-06-24 16:42:21adminsetmessages: + msg14204
2024-06-24 16:42:21adminsetstatus: new -> ready
2024-06-22 11:54:59adminsetmessages: + msg14172
2024-06-22 00:00:00admincreate