Boost logo

Boost Users :

Subject: [Boost-users] [Integer] Is size_t as fast as uint_value_t<SIZE_MAX>::fast?
From: jsnhblck_at_[hidden]
Date: 2012-08-02 18:34:20


=====================================
#include<boost/integer.hpp>
#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<SIZE_MAX>::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.

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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net