From 67efd5c6275078eac948be74d5a581417b10b5d5 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Fri, 25 May 2007 23:58:33 +0000 Subject: [PATCH] Full namespace for std::size_t. [SVN r37779] --- include/boost/functional/hash/hash.hpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/boost/functional/hash/hash.hpp b/include/boost/functional/hash/hash.hpp index 94391d7..86e60f3 100644 --- a/include/boost/functional/hash/hash.hpp +++ b/include/boost/functional/hash/hash.hpp @@ -96,42 +96,42 @@ namespace boost namespace hash_detail { template - 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::digits; + const int size_t_bits = std::numeric_limits::digits; // ceiling(std::numeric_limits::digits / size_t_bits) - 1 const int length = (std::numeric_limits::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 - 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::digits; + const int size_t_bits = std::numeric_limits::digits; // ceiling(std::numeric_limits::digits / size_t_bits) - 1 const int length = (std::numeric_limits::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; }