]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/core/default_allocator.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / core / default_allocator.hpp
index 9fc3ea2604a5084e0a19105ae65c4171c2c97c5d..9e466ca7075f52dff1c087a7278000c0d916895e 100644 (file)
@@ -10,11 +10,6 @@ Distributed under the Boost Software License, Version 1.0.
 
 #include <boost/config.hpp>
 #include <new>
-#include <climits>
-
-#if defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 60000
-#define BOOST_CORE_NO_CXX11_ALLOCATOR
-#endif
 
 namespace boost {
 
@@ -81,16 +76,9 @@ struct default_allocator {
     BOOST_CONSTEXPR default_allocator(const default_allocator<U>&)
         BOOST_NOEXCEPT { }
 
-#if defined(PTRDIFF_MAX) && defined(SIZE_MAX)
-    BOOST_CONSTEXPR std::size_t max_size() const BOOST_NOEXCEPT {
-        return PTRDIFF_MAX < SIZE_MAX / sizeof(T)
-            ? PTRDIFF_MAX : SIZE_MAX / sizeof(T);
-    }
-#else
     BOOST_CONSTEXPR std::size_t max_size() const BOOST_NOEXCEPT {
-        return ~static_cast<std::size_t>(0) / sizeof(T);
+        return static_cast<std::size_t>(-1) / (2 < sizeof(T) ? sizeof(T) : 2);
     }
-#endif
 
 #if !defined(BOOST_NO_EXCEPTIONS)
     T* allocate(std::size_t n) {
@@ -120,7 +108,8 @@ struct default_allocator {
     }
 #endif
 
-#if defined(BOOST_NO_CXX11_ALLOCATOR) || defined(BOOST_CORE_NO_CXX11_ALLOCATOR)
+#if (defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 60000) || \
+    defined(BOOST_NO_CXX11_ALLOCATOR)
     template<class U, class V>
     void construct(U* p, const V& v) {
         ::new(p) U(v);
@@ -129,6 +118,7 @@ struct default_allocator {
     template<class U>
     void destroy(U* p) {
         p->~U();
+        (void)p;
     }
 #endif
 };