https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86015
--- Comment #8 from Josh Marshall <joshua.r.marshall.1991 at gmail dot com> --- If this code is to work, given that this is the only way to track in detail use of various stdlib internals, one of two things need to change. Either all assignments to _Distance need to be explicitly wrapped and the constructor from a scalar make explicit with implicit conversion to an int, or implicit conversion from int without conversion to int and all uses of _Distance do not explicitly require a scalar but a set of operators which can be applied to a scalar be implemented by _Distance. I can quickly submit a patch for the first one, but I'm not sure it is the right approach. I'm going to ask this in the C++ standards forum tomorrow and maybe they'll have insight about changing the nature of std::ptrdiff_t.