I just saw some C++ code like this. It was using a condition to decide whether to walk forward or backward through a std::vector. The compiler doesn\'t complain, b
std::vector
Whenever I need to deal with signed types, I always use:
typedef std::make_signed::type ssize_t; // Since C++11
...as a signed alternative to std::size_t.
I appreciate this question is a few years old, but I'm hoping that will help others. Credit to moodycamel::ConcurrentQueue.