summaryrefslogtreecommitdiff
path: root/boost/intrusive/pointer_plus_bits.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/intrusive/pointer_plus_bits.hpp')
-rw-r--r--boost/intrusive/pointer_plus_bits.hpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/boost/intrusive/pointer_plus_bits.hpp b/boost/intrusive/pointer_plus_bits.hpp
index 117aff3c58..6168ea8ea4 100644
--- a/boost/intrusive/pointer_plus_bits.hpp
+++ b/boost/intrusive/pointer_plus_bits.hpp
@@ -64,25 +64,25 @@ struct pointer_plus_bits
template<class T, std::size_t NumBits>
struct pointer_plus_bits<T*, NumBits>
{
- static const std::size_t Mask = ((std::size_t(1u) << NumBits) - 1);
+ static const uintptr_t Mask = uintptr_t((uintptr_t(1u) << NumBits) - 1);
typedef T* pointer;
static pointer get_pointer(pointer n)
- { return pointer(std::size_t(n) & ~Mask); }
+ { return pointer(uintptr_t(n) & uintptr_t(~Mask)); }
static void set_pointer(pointer &n, pointer p)
{
- BOOST_INTRUSIVE_INVARIANT_ASSERT(0 == (std::size_t(p) & Mask));
- n = pointer(std::size_t(p) | (std::size_t(n) & Mask));
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(0 == (uintptr_t(p) & Mask));
+ n = pointer(uintptr_t(p) | (uintptr_t(n) & Mask));
}
static std::size_t get_bits(pointer n)
- { return (std::size_t(n) & Mask); }
+ { return std::size_t(uintptr_t(n) & Mask); }
static void set_bits(pointer &n, std::size_t c)
{
- BOOST_INTRUSIVE_INVARIANT_ASSERT(c <= Mask);
- n = pointer(std::size_t(get_pointer(n)) | c);
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(uintptr_t(c) <= Mask);
+ n = pointer(uintptr_t((get_pointer)(n)) | uintptr_t(c));
}
};