#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 {
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) {
}
#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);
template<class U>
void destroy(U* p) {
p->~U();
+ (void)p;
}
#endif
};