diff options
Diffstat (limited to 'boost/interprocess/detail/utilities.hpp')
-rw-r--r-- | boost/interprocess/detail/utilities.hpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/boost/interprocess/detail/utilities.hpp b/boost/interprocess/detail/utilities.hpp index e1be2f1598..c1b23423c2 100644 --- a/boost/interprocess/detail/utilities.hpp +++ b/boost/interprocess/detail/utilities.hpp @@ -156,29 +156,29 @@ BOOST_INTERPROCESS_FORCEINLINE bool size_overflows(SizeType count) return multiplication_overflows(SizeType(SztSizeOfType), count); } -template<class RawPointer> -class pointer_uintptr_caster; +template<class RawPointer, class OffsetType> +class pointer_offset_caster; -template<class T> -class pointer_uintptr_caster<T*> +template<class T, class OffsetType> +class pointer_offset_caster<T*, OffsetType> { public: - BOOST_INTERPROCESS_FORCEINLINE explicit pointer_uintptr_caster(uintptr_t sz) - : m_uintptr(sz) + BOOST_INTERPROCESS_FORCEINLINE explicit pointer_offset_caster(OffsetType offset) + : m_offset(offset) {} - BOOST_INTERPROCESS_FORCEINLINE explicit pointer_uintptr_caster(const volatile T *p) - : m_uintptr(reinterpret_cast<uintptr_t>(p)) + BOOST_INTERPROCESS_FORCEINLINE explicit pointer_offset_caster(const volatile T *p) + : m_offset(reinterpret_cast<OffsetType>(p)) {} - BOOST_INTERPROCESS_FORCEINLINE uintptr_t uintptr() const - { return m_uintptr; } + BOOST_INTERPROCESS_FORCEINLINE OffsetType offset() const + { return m_offset; } BOOST_INTERPROCESS_FORCEINLINE T* pointer() const - { return reinterpret_cast<T*>(m_uintptr); } + { return reinterpret_cast<T*>(m_offset); } private: - uintptr_t m_uintptr; + OffsetType m_offset; }; |