[iterator.concept.winc]#3 requires an integer-class type to be able to represent values either from $−2^{N−1}$ to $2^{N−1}−1$ or from 0 to $2^N-1$:
The range of representable values of an integer-class type is the continuous set of values over which it is defined. For any integer-class type, its range of representable values is either $−2^{N−1}$ to $2^{N−1}−1$ (inclusive) for some integer N, in which case it is a signed-integer-class type, or 0 to $2^N-1$ (inclusive) for some integer N, in which case it is an unsigned-integer-class type.
However, the following code:
#include <limits>
#include <iostream>
#include <cstdint>
#include <range/v3/all.hpp>
int main(){
auto r = ranges::cpp20::views::iota(std::uintmax_t(0), std::uintmax_t(1));
using t = ranges::cpp20::range_difference_t<decltype(r)>;
std::cout << std::numeric_limits<t>::min() << ' ';
std::cout << std::numeric_limits<t>::max() << std::endl;
return 0;
}
gives the output -18446744073709551615 18446744073709551615 on compiler explorer, which doesn't fit the above requirements.
[iterator.concept.winc]#3 requires an integer-class type to be able to represent values either from $−2^{N−1}$ to $2^{N−1}−1$ or from 0 to $2^N-1$:
However, the following code:
gives the output
-18446744073709551615 18446744073709551615
on compiler explorer, which doesn't fit the above requirements.