mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 19:37:14 +02:00
Unordered: Use destroy
workaround for allocator_traits
.
[SVN r74235]
This commit is contained in:
@ -56,6 +56,22 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
|
|
||||||
namespace boost { namespace unordered { namespace detail {
|
namespace boost { namespace unordered { namespace detail {
|
||||||
|
|
||||||
|
// Explicitly call a destructor
|
||||||
|
|
||||||
|
#if defined(BOOST_MSVC)
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable:4100) // unreferenced formal parameter
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
inline void destroy(T* x) {
|
||||||
|
x->~T();
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(BOOST_MSVC)
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS
|
#if BOOST_UNORDERED_USE_ALLOCATOR_TRAITS
|
||||||
template <typename Alloc>
|
template <typename Alloc>
|
||||||
struct allocator_traits : std::allocator_traits<Alloc> {};
|
struct allocator_traits : std::allocator_traits<Alloc> {};
|
||||||
@ -364,7 +380,7 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
static void destroy(Alloc&, T* p, typename
|
static void destroy(Alloc&, T* p, typename
|
||||||
boost::disable_if<has_destroy<Alloc, T>, void*>::type = 0)
|
boost::disable_if<has_destroy<Alloc, T>, void*>::type = 0)
|
||||||
{
|
{
|
||||||
p->~T();
|
::boost::unordered::detail::destroy(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_type max_size(const Alloc& a)
|
static size_type max_size(const Alloc& a)
|
||||||
|
@ -117,22 +117,6 @@ namespace boost { namespace unordered { namespace detail {
|
|||||||
struct map_extractor;
|
struct map_extractor;
|
||||||
struct no_key;
|
struct no_key;
|
||||||
|
|
||||||
// Explicitly call a destructor
|
|
||||||
|
|
||||||
#if defined(BOOST_MSVC)
|
|
||||||
#pragma warning(push)
|
|
||||||
#pragma warning(disable:4100) // unreferenced formal parameter
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
inline void destroy(T* x) {
|
|
||||||
x->~T();
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(BOOST_MSVC)
|
|
||||||
#pragma warning(pop)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(BOOST_NO_RVALUE_REFERENCES)
|
#if !defined(BOOST_NO_RVALUE_REFERENCES)
|
||||||
|
|
||||||
#define BOOST_UNORDERED_RV_REF(T) BOOST_RV_REF(T)
|
#define BOOST_UNORDERED_RV_REF(T) BOOST_RV_REF(T)
|
||||||
|
Reference in New Issue
Block a user