mirror of
https://git.suyu.dev/suyu/ext-boost.git
synced 2025-12-23 06:06:13 +01:00
Update to boost v1.63.0
This commit is contained in:
parent
f005c955f8
commit
25db91d480
535 changed files with 20797 additions and 37185 deletions
|
|
@ -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); }
|
||||
BOOST_INTRUSIVE_FORCEINLINE static pointer get_pointer(pointer n)
|
||||
{ return pointer(uintptr_t(n) & uintptr_t(~Mask)); }
|
||||
|
||||
static void set_pointer(pointer &n, pointer p)
|
||||
BOOST_INTRUSIVE_FORCEINLINE 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); }
|
||||
BOOST_INTRUSIVE_FORCEINLINE static std::size_t get_bits(pointer n)
|
||||
{ return std::size_t(uintptr_t(n) & Mask); }
|
||||
|
||||
static void set_bits(pointer &n, std::size_t c)
|
||||
BOOST_INTRUSIVE_FORCEINLINE 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));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue