#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
+#include <boost/type_traits/is_empty.hpp>
#include <memory>
#else
#include <boost/detail/workaround.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/multi_index/detail/vartempl_support.hpp>
#include <boost/type_traits/integral_constant.hpp>
+#include <boost/type_traits/is_empty.hpp>
#include <new>
#endif
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
+template<typename T> struct void_helper{typedef void type;};
+
+template<typename Allocator,typename=void>
+struct allocator_is_always_equal:boost::is_empty<Allocator>{};
+
+template<typename Allocator>
+struct allocator_is_always_equal<
+ Allocator,
+ typename void_helper<
+ typename std::allocator_traits<Allocator>::is_always_equal
+ >::type
+>:std::allocator_traits<Allocator>::is_always_equal{};
+
template<typename Allocator>
struct allocator_traits:std::allocator_traits<Allocator>
{
typedef std::allocator_traits<Allocator> super;
+ /* pre-C++17 compatibilty */
+
+ typedef allocator_is_always_equal<Allocator> is_always_equal;
+
template<typename T>
struct rebind_alloc
{
typedef typename Allocator::difference_type difference_type;
typedef typename Allocator::size_type size_type;
- typedef boost::false_type propagate_on_container_copy_assignment;
- typedef boost::false_type propagate_on_container_move_assignment;
- typedef boost::false_type propagate_on_container_swap;
+ typedef boost::false_type propagate_on_container_copy_assignment;
+ typedef boost::false_type propagate_on_container_move_assignment;
+ typedef boost::false_type propagate_on_container_swap;
+ typedef boost::is_empty<Allocator> is_always_equal;
template<typename T>
struct rebind_alloc