std::size_t or std::vector<Foo>::size_type?
问题 When I loop on a std::vector<Foo> (or every container having random access iterator) I use an unsigned integer variable i . If I want to respect the norm, should I use std::size_t or the type given by the container itself : std::vector<Foo>::size_type ? If I chose std::size_t (for readability reasons), can I be sure that every implementation of every container in std namespace uses std::size_t as size_type ? Note : I use C++98 only (for compatibility reasons). 回答1: It is not necessarily true