Hi,
I recently thought about size_t vs std::size_t and ended to the conclusion that std::size_t should be used if the code is c++.
Is it a correct conclusion about the both ?
I then was curious about Unreal Engine and saw this:
template<typename T32BITS, typename T64BITS, int PointerSize>
struct SelectIntPointerType
{
// nothing here are is it an error if the partial specializations fail
};
template<typename T32BITS, typename T64BITS>
struct SelectIntPointerType<T32BITS, T64BITS, 8>
{
typedef T64BITS TIntPointer; // select the 64 bit type
};
template<typename T32BITS, typename T64BITS>
struct SelectIntPointerType<T32BITS, T64BITS, 4>
{
typedef T32BITS TIntPointer; // select the 32 bit type
};
typedef SelectIntPointerType<uint32, uint64, sizeof(void*)>::TIntPointer UPTRINT;
typedef UPTRINT SIZE_T;
Any thought about it ? Is it a good way and safe ?
Thank you