summaryrefslogtreecommitdiff
path: root/libs/intrusive/test/bounded_pointer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/intrusive/test/bounded_pointer.hpp')
-rw-r--r--libs/intrusive/test/bounded_pointer.hpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/libs/intrusive/test/bounded_pointer.hpp b/libs/intrusive/test/bounded_pointer.hpp
index 485930082..b6d568ac9 100644
--- a/libs/intrusive/test/bounded_pointer.hpp
+++ b/libs/intrusive/test/bounded_pointer.hpp
@@ -20,6 +20,7 @@
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/intrusive/pointer_traits.hpp>
#include <boost/core/no_exceptions_support.hpp>
+#include <boost/move/adl_move_swap.hpp>
template < typename T >
class bounded_pointer;
@@ -67,10 +68,10 @@ class bounded_pointer
operator= (const bounded_pointer<T2> & other)
{ m_offset = other.m_offset; return *this; }
- const bounded_pointer< typename boost::intrusive::detail::remove_const< T >::type >& unconst() const
- { return *reinterpret_cast< const bounded_pointer< typename boost::intrusive::detail::remove_const< T >::type >* >(this); }
+ const bounded_pointer< typename boost::intrusive::detail::remove_const< T >::type >& unconst() const
+ { return *reinterpret_cast< const bounded_pointer< typename boost::intrusive::detail::remove_const< T >::type >* >(this); }
- bounded_pointer< typename boost::intrusive::detail::remove_const< T >::type >& unconst()
+ bounded_pointer< typename boost::intrusive::detail::remove_const< T >::type >& unconst()
{ return *reinterpret_cast< bounded_pointer< typename boost::intrusive::detail::remove_const< T >::type >* >(this); }
static mut_val_t* base()
@@ -150,7 +151,7 @@ class bounded_reference
bounded_reference()
: m_offset(max_offset)
{}
-
+
bounded_reference(const bounded_reference& other)
: m_offset(other.m_offset)
{}
@@ -190,7 +191,7 @@ class bounded_reference
// the copy asop is shallow; we need swap overload to shuffle a vector of references
friend void swap(bounded_reference& lhs, bounded_reference& rhs)
- { std::swap(lhs.m_offset, rhs.m_offset); }
+ { ::boost::adl_move_swap(lhs.m_offset, rhs.m_offset); }
private:
template <typename> friend class bounded_reference;
@@ -221,7 +222,7 @@ class bounded_allocator
m_in_use[p.m_offset] = true;
return p;
}
-
+
void deallocate(pointer p, size_t n)
{
assert(inited());
@@ -238,12 +239,12 @@ class bounded_allocator
// allocate non-constructed storage
m_base = static_cast< T* >(::operator new [] (max_offset * sizeof(T)));
}
-
+
static bool inited()
{
return m_in_use.size() == max_offset;
}
-
+
static bool is_clear()
{
assert(inited());
@@ -256,7 +257,7 @@ class bounded_allocator
}
return true;
}
-
+
static void destroy()
{
// deallocate storage without destructors