Can iterator types of range adaptors and range factories be SCARY?
Jiang An

Created on 2023-03-18.00:00:00 last changed 1 week ago


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.

Date User Action Args
2023-03-18 00:00:00admincreate