]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/multi_index/detail/allocator_traits.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / multi_index / detail / allocator_traits.hpp
index f3c8ef597075daee7b1be64940632d8f3af7e2b6..45903b75f0839aa6183c5ace617ccf26020418dd 100644 (file)
@@ -16,6 +16,7 @@
 #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>
@@ -23,6 +24,7 @@
 #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
 
@@ -36,6 +38,19 @@ namespace detail{
 
 #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>
 {
@@ -43,6 +58,10 @@ 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
   {
@@ -76,9 +95,10 @@ struct allocator_traits
   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