I see variables defined with this type but I don\'t know where it comes from, nor what is its purpose. Why not use int or unsigned int? (What about other \"similar\" types?
In minimalistic programs where a size_t
definition was not loaded "by chance" in some include but I still need it in some context (for example to access std::vector
), then I use that context to extract the correct type. For example typedef std::vector
.
(Surround with namespace {...}
if necessary to make the scope limited.)