Check for cast of a pointer to wider (even unsigned) integer. This will sign-extend the pointer which happens on 32-bit hosts for 64-bit integers:
void *p=(void *)0x80000000; printf( "%p" "\n", p ); // 0x80000000 printf("0x%" PRIxPTR "\n", (uintptr_t)p ); // 0x80000000 printf("0x%" PRIx64 "\n", reinterpret_cast<uint64_t>(p)); // 0xffffffff80000000 printf("0x%" PRIx64 "\n", (uint64_t) p ); // 0xffffffff80000000 printf("0x%" PRIx64 "\n", (uint64_t)(uintptr_t)p ); // 0x80000000
This function doesn't need to be a member function, it doesn't rely on the class state whatsoever. I think the function should not take the container but instead be a templated function accepting iterators.