What is uintptr_t
and what can it be used for?
uintptr_t
is an unsigned integer type that is capable of storing a data pointer. Which typically means that it's the same size as a pointer.
It is optionally defined in C++11 and later standards.
A common reason to want an integer type that can hold an architecture's pointer type is to perform integer-specific operations on a pointer, or to obscure the type of a pointer by providing it as an integer "handle".