https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102181

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
You need to use std::ranges::advance here, because iota_view is "special".

The reason std::advance doesn't work is that the type of v.begin() does not
meet the Cpp17InputIterator requirements, because its difference_type is
__int128, which is not a signed integer type when using -std=c++17 (but it is
when using -std=gnu++20). Failing to meet the Cpp17InputIterator requirements
means that std::iterator_traits<decltype(b)>::iterator_category defaults to
output_iterator_tag. And you can't advance an output iterator.

Reply via email to