In some code I\'ve inherited, I see frequent use of size_t
with the std
namespace qualifier. For example:
std::size_t n = sizeof(
The GNU compiler headers contain something like
typedef long int __PTRDIFF_TYPE__; typedef unsigned long int __SIZE_TYPE__;
Then stddef.h constains something like
typedef __PTRDIFF_TYPE__ ptrdiff_t; typedef __SIZE_TYPE__ size_t;
And finally the cstddef file contains something like
#includenamespace std { using ::ptrdiff_t; using ::size_t; }
I think that should make it clear. As long as you include
typedef long int ptrdiff_t; typedef unsigned long int size_t; namespace std { using ::ptrdiff_t; using ::size_t; }