mirror of
https://github.com/boostorg/container.git
synced 2025-08-03 14:34:27 +02:00
Use pointer traits to obtain element_type in "to_raw_pointer"
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
#include <boost/type_traits/has_trivial_copy.hpp>
|
#include <boost/type_traits/has_trivial_copy.hpp>
|
||||||
#include <boost/type_traits/has_trivial_assign.hpp>
|
#include <boost/type_traits/has_trivial_assign.hpp>
|
||||||
#include <boost/container/detail/memory_util.hpp>
|
#include <boost/container/detail/memory_util.hpp>
|
||||||
|
#include <boost/intrusive/pointer_traits.hpp>
|
||||||
#include <boost/aligned_storage.hpp>
|
#include <boost/aligned_storage.hpp>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
@@ -159,7 +160,7 @@ inline T* to_raw_pointer(T* p)
|
|||||||
{ return p; }
|
{ return p; }
|
||||||
|
|
||||||
template <class Pointer>
|
template <class Pointer>
|
||||||
inline typename Pointer::element_type*
|
inline typename boost::intrusive::pointer_traits<Pointer>::element_type*
|
||||||
to_raw_pointer(const Pointer &p)
|
to_raw_pointer(const Pointer &p)
|
||||||
{ return boost::container::container_detail::to_raw_pointer(p.operator->()); }
|
{ return boost::container::container_detail::to_raw_pointer(p.operator->()); }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user