I was very surprised to see that I std::countreturned iterator_traits<InputIterator>::difference_type, which in turn applies to long inton my platform.
std::count
iterator_traits<InputIterator>::difference_type
long int
Why? Negative counting elements in a container make no sense.
Actually it is std::ptrdiff_twhich should be a signed integer. It must be signed because it can be used as the difference between two iterators, and this can, of course, be negative.
std::ptrdiff_t