Open
Description
Describe the bug
[range.iota] describes the iterator and sentinel types of iota_view
as nested classes, but MSVC STL doesn't follow the wording. Difference from the standard wording is observable via ADL (Godbolt link).
#include <ranges>
constexpr int foo(auto) noexcept { return 42; } // selected by libc++ & libstdc++
namespace fvs {
constexpr int foo(std::input_iterator auto) noexcept { return 0; } // selected by MSVC STL
struct bar {};
}
using ioit = std::ranges::iterator_t<std::ranges::iota_view<fvs::bar*, fvs::bar*>>;
static_assert(foo(ioit{}) == 42);
I think we should make them non-template classes nested in class templates. IIUC the enclosing class is not nessarily iota_view
, which allows SCARY implementation strategies.
See also