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

Created on 2024-06-22.00:00:00 last changed 2 months ago

Messages

Date: 2024-06-24.16:42:21

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-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-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