Update of /cvsroot/boost/boost/boost/functional/hash
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14880/hash
Modified Files:
hash.hpp
Log Message:
Full namespace for std::size_t.
Index: hash.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/functional/hash/hash.hpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- hash.hpp 12 Apr 2007 20:33:48 -0000 1.35
+++ hash.hpp 25 May 2007 23:58:33 -0000 1.36
@@ -96,42 +96,42 @@
namespace hash_detail
{
template <class T>
- inline size_t hash_value_signed(T val)
+ inline std::size_t hash_value_signed(T val)
{
- const int size_t_bits = std::numeric_limits<size_t>::digits;
+ const int size_t_bits = std::numeric_limits<std::size_t>::digits;
// ceiling(std::numeric_limits<T>::digits / size_t_bits) - 1
const int length = (std::numeric_limits<T>::digits - 1)
/ size_t_bits;
- size_t seed = 0;
+ std::size_t seed = 0;
T positive = val < 0 ? -1 - val : val;
// Hopefully, this loop can be unrolled.
for(unsigned int i = length * size_t_bits; i > 0; i -=
size_t_bits)
{
- seed ^= (size_t) (positive >> i) + (seed<<6) + (seed>>2);
+ seed ^= (std::size_t) (positive >> i) + (seed<<6) + (seed>>2);
}
- seed ^= (size_t) val + (seed<<6) + (seed>>2);
+ seed ^= (std::size_t) val + (seed<<6) + (seed>>2);
return seed;
}
template <class T>
- inline size_t hash_value_unsigned(T val)
+ inline std::size_t hash_value_unsigned(T val)
{
- const int size_t_bits = std::numeric_limits<size_t>::digits;
+ const int size_t_bits = std::numeric_limits<std::size_t>::digits;
// ceiling(std::numeric_limits<T>::digits / size_t_bits) - 1
const int length = (std::numeric_limits<T>::digits - 1)
/ size_t_bits;
- size_t seed = 0;
+ std::size_t seed = 0;
// Hopefully, this loop can be unrolled.
for(unsigned int i = length * size_t_bits; i > 0; i -=
size_t_bits)
{
- seed ^= (size_t) (val >> i) + (seed<<6) + (seed>>2);
+ seed ^= (std::size_t) (val >> i) + (seed<<6) + (seed>>2);
}
- seed ^= (size_t) val + (seed<<6) + (seed>>2);
+ seed ^= (std::size_t) val + (seed<<6) + (seed>>2);
return seed;
}
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs