[Integer] Is size_t as fast as uint_value_t<SIZE_MAX>::fast?

=====================================
#include

AMDG On 08/02/2012 03:34 PM, jsnhblck@gmail.com wrote:
===================================== #include
#ifndef SIZE_MAX #define SIZE_MAX ((size_t)-1) #endif /*It is the 'fast' size_t (unsigned integer type of the platform) */ typedef boost::uint_value_t ::fast fsize_t; =====================================
Would the above code make any difference cross-platform? Is size_t as fast (cross-platform) as the above typedef?
I believe that the above code converts whatever size_t is defined as into something that is 'fast'- the easiest for the processor to manipulate. However, what I don't know is whether size_t is already that.
It's highly unlikely that fsize_t is different from size_t. (It might be a different type with the same size, but that won't affect performance).
Also, I noticed that boost::hash returns 'size_t' so was just wondering why. I will be using hashes in different collections so had tried (above) to store them using the 'fast' boost::integer form.
In Christ, Steven Watanabe
participants (2)
-
jsnhblck@gmail.com
-
Steven Watanabe