Title
Can iterator types of range adaptors and range factories be SCARY?
Status
new
Section
[range.factories][range.adaptors]
Submitter
Jiang An

Created on 2023-03-18.00:00:00 last changed 11 months ago

Messages

Date: 2023-06-15.00:00:00

[ 2023-06-01; Reflector poll ]

Set priority to 3 after reflector poll.

"The ADL hiding stuff is a red herring - SCARY-ness doesn't prevent ADL hiding. Shouldn't require them to be different types (and similarly should not require const/non-const iterators to be implemented as class templates with a single bool template parameter)."

Date: 2023-03-18.00:00:00

[For the term SCARY see N2911 and N2913.]

In [range.factories] and [range.adaptors], many iterator types are specified as exposition-only nested classes or nested class templates.

This has some observable differences from specifying them as class templates declared in the namespace scope:

  1. value types are generally not associated entities of iterators or sentinels during ADL, which prevents unintended overloads to be found;

  2. two different range adaptor/factory types, e.g. iota_view<I, S1> and iota_view<I, S2>, have different iterator types.

The ADL reduction seems preferable. However, is it intended to required to any two different range adaptor/factory types to have two different iterator types, even when the same iterator type can work as expected?

Sentinel types don't seem able to be SCARY as they are dependent on iterator types.

History
Date User Action Args
2023-06-01 14:48:40adminsetmessages: + msg13611
2023-03-18 00:00:00admincreate