C++ containers have the notorious signed/unsigned problem. Through Yocto indices are sometimes signed, when explicitly supporting 64bit, or signed, when 32bit is required. On GCC/clang default settings this works fine, since no warnings are issued when comparing signed and unsigned values. On MSVC, this does not work as well.
One possibility is to pedantically use unsigned everywhere, but that is problematic in other manners, in particular since unsigned comparisons are prone to error due to wrapping.
The other option is to always use signed comparison, which may mean switching to signed std::ssize(). We should investigate this option and see if it solves the issue.
C++ containers have the notorious signed/unsigned problem. Through Yocto indices are sometimes signed, when explicitly supporting 64bit, or signed, when 32bit is required. On GCC/clang default settings this works fine, since no warnings are issued when comparing signed and unsigned values. On MSVC, this does not work as well.
One possibility is to pedantically use unsigned everywhere, but that is problematic in other manners, in particular since unsigned comparisons are prone to error due to wrapping.
The other option is to always use signed comparison, which may mean switching to signed
std::ssize()
. We should investigate this option and see if it solves the issue.