]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/container/detail/container_rebind.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / container / detail / container_rebind.hpp
index 0ebb4789e405eb659642f1b4f135e2b8f60c3e28..0af9b9e9f4cec83899aab7d7c352275cfbb6b467 100644 (file)
@@ -19,6 +19,7 @@
 #endif
 
 #include <boost/container/allocator_traits.hpp>
+#include <boost/container/container_fwd.hpp>
 
 
 namespace boost {
@@ -33,14 +34,14 @@ namespace dtl {
    template <template <class, class, class...> class Cont, typename V, typename A, class... An, class U>
    struct container_rebind<Cont<V, A, An...>, U>
    {
-      typedef Cont<U, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, An...> type;
+      typedef Cont<U, typename allocator_traits<typename real_allocator<V, A>::type>::template portable_rebind_alloc<U>::type, An...> type;
    };
 
    //Needed for non-conforming compilers like GCC 4.3
    template <template <class, class> class Cont, typename V, typename A, class U>
    struct container_rebind<Cont<V, A>, U>
    {
-      typedef Cont<U, typename allocator_traits<A>::template portable_rebind_alloc<U>::type> type;
+      typedef Cont<U, typename allocator_traits<typename real_allocator<V, A>::type>::template portable_rebind_alloc<U>::type> type;
    };
 
    template <template <class> class Cont, typename V, class U>
@@ -49,27 +50,6 @@ namespace dtl {
       typedef Cont<U> type;
    };
 
-   //for small_vector,static_vector
-
-   template <template <class, std::size_t, class, class...> class Cont, typename V, std::size_t N, typename A, class... An, class U>
-   struct container_rebind<Cont<V, N, A, An...>, U>
-   {
-      typedef Cont<U, N, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, An...> type;
-   };
-
-   //Needed for non-conforming compilers like GCC 4.3
-   template <template <class, std::size_t, class> class Cont, typename V, std::size_t N, typename A, class U>
-   struct container_rebind<Cont<V, N, A>, U>
-   {
-      typedef Cont<U, N, typename allocator_traits<A>::template portable_rebind_alloc<U>::type> type;
-   };
-
-   template <template <class, std::size_t> class Cont, typename V, std::size_t N, class U>
-   struct container_rebind<Cont<V, N>, U>
-   {
-      typedef Cont<U, N> type;
-   };
-
 #else //C++03 compilers
 
    template <template <class> class Cont  //0arg
@@ -85,7 +65,7 @@ namespace dtl {
       , class U>
       struct container_rebind<Cont<V, A>, U>
    {
-      typedef Cont<U, typename allocator_traits<A>::template portable_rebind_alloc<U>::type> type;
+      typedef Cont<U, typename allocator_traits<typename real_allocator<V, A>::type>::template portable_rebind_alloc<U>::type> type;
    };
 
    template <template <class, class, class> class Cont  //1arg
@@ -93,7 +73,7 @@ namespace dtl {
       , class U>
       struct container_rebind<Cont<V, A, P0>, U>
    {
-      typedef Cont<U, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0> type;
+      typedef Cont<U, typename allocator_traits<typename real_allocator<V, A>::type>::template portable_rebind_alloc<U>::type, P0> type;
    };
 
    template <template <class, class, class, class> class Cont  //2arg
@@ -101,7 +81,7 @@ namespace dtl {
       , class U>
       struct container_rebind<Cont<V, A, P0, P1>, U>
    {
-      typedef Cont<U, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0, P1> type;
+      typedef Cont<U, typename allocator_traits<typename real_allocator<V, A>::type>::template portable_rebind_alloc<U>::type, P0, P1> type;
    };
 
    template <template <class, class, class, class, class> class Cont  //3arg
@@ -109,7 +89,7 @@ namespace dtl {
       , class U>
       struct container_rebind<Cont<V, A, P0, P1, P2>, U>
    {
-      typedef Cont<U, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0, P1, P2> type;
+      typedef Cont<U, typename allocator_traits<typename real_allocator<V, A>::type>::template portable_rebind_alloc<U>::type, P0, P1, P2> type;
    };
 
    template <template <class, class, class, class, class, class> class Cont  //4arg
@@ -117,7 +97,7 @@ namespace dtl {
       , class U>
       struct container_rebind<Cont<V, A, P0, P1, P2, P3>, U>
    {
-      typedef Cont<U, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3> type;
+      typedef Cont<U, typename allocator_traits<typename real_allocator<V, A>::type>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3> type;
    };
 
    template <template <class, class, class, class, class, class, class> class Cont  //5arg
@@ -125,7 +105,7 @@ namespace dtl {
       , class U>
       struct container_rebind<Cont<V, A, P0, P1, P2, P3, P4>, U>
    {
-      typedef Cont<U, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3, P4> type;
+      typedef Cont<U, typename allocator_traits<typename real_allocator<V, A>::type>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3, P4> type;
    };
 
    template <template <class, class, class, class, class, class, class, class> class Cont  //6arg
@@ -133,7 +113,7 @@ namespace dtl {
       , class U>
       struct container_rebind<Cont<V, A, P0, P1, P2, P3, P4, P5>, U>
    {
-      typedef Cont<U, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3, P4, P5> type;
+      typedef Cont<U, typename allocator_traits<typename real_allocator<V, A>::type>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3, P4, P5> type;
    };
 
    template <template <class, class, class, class, class, class, class, class, class> class Cont  //7arg
@@ -141,7 +121,7 @@ namespace dtl {
       , class U>
       struct container_rebind<Cont<V, A, P0, P1, P2, P3, P4, P5, P6>, U>
    {
-      typedef Cont<U, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3, P4, P5, P6> type;
+      typedef Cont<U, typename allocator_traits<typename real_allocator<V, A>::type>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3, P4, P5, P6> type;
    };
 
    template <template <class, class, class, class, class, class, class, class, class, class> class Cont  //8arg
@@ -149,7 +129,7 @@ namespace dtl {
       , class U>
       struct container_rebind<Cont<V, A, P0, P1, P2, P3, P4, P5, P6, P7>, U>
    {
-      typedef Cont<U, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3, P4, P5, P6, P7> type;
+      typedef Cont<U, typename allocator_traits<typename real_allocator<V, A>::type>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3, P4, P5, P6, P7> type;
    };
 
    template <template <class, class, class, class, class, class, class, class, class, class, class> class Cont  //9arg
@@ -157,100 +137,25 @@ namespace dtl {
       , class U>
       struct container_rebind<Cont<V, A, P0, P1, P2, P3, P4, P5, P6, P7, P8>, U>
    {
-      typedef Cont<U, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3, P4, P5, P6, P7, P8> type;
-   };
-
-   //For small_vector/static_vector
-   template <template <class, std::size_t> class Cont  //0arg
-      , typename V, std::size_t N
-      , class U>
-      struct container_rebind<Cont<V, N>, U>
-   {
-      typedef Cont<U, N> type;
-   };
-
-   template <template <class, std::size_t, class> class Cont  //0arg
-      , typename V, std::size_t N, typename A
-      , class U>
-      struct container_rebind<Cont<V, N, A>, U>
-   {
-      typedef Cont<U, N, typename allocator_traits<A>::template portable_rebind_alloc<U>::type> type;
-   };
-
-   template <template <class, std::size_t, class, class> class Cont  //1arg
-      , typename V, std::size_t N, typename A, class P0
-      , class U>
-      struct container_rebind<Cont<V, N, A, P0>, U>
-   {
-      typedef Cont<U, N, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0> type;
-   };
-
-   template <template <class, std::size_t, class, class, class> class Cont  //2arg
-      , typename V, std::size_t N, typename A, class P0, class P1
-      , class U>
-      struct container_rebind<Cont<V, N, A, P0, P1>, U>
-   {
-      typedef Cont<U, N, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0, P1> type;
-   };
-
-   template <template <class, std::size_t, class, class, class, class> class Cont  //3arg
-      , typename V, std::size_t N, typename A, class P0, class P1, class P2
-      , class U>
-      struct container_rebind<Cont<V, N, A, P0, P1, P2>, U>
-   {
-      typedef Cont<U, N, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0, P1, P2> type;
-   };
-
-   template <template <class, std::size_t, class, class, class, class, class> class Cont  //4arg
-      , typename V, std::size_t N, typename A, class P0, class P1, class P2, class P3
-      , class U>
-      struct container_rebind<Cont<V, N, A, P0, P1, P2, P3>, U>
-   {
-      typedef Cont<U, N, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3> type;
-   };
-
-   template <template <class, std::size_t, class, class, class, class, class, class> class Cont  //5arg
-      , typename V, std::size_t N, typename A, class P0, class P1, class P2, class P3, class P4
-      , class U>
-      struct container_rebind<Cont<V, N, A, P0, P1, P2, P3, P4>, U>
-   {
-      typedef Cont<U, N, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3, P4> type;
+      typedef Cont<U, typename allocator_traits<typename real_allocator<V, A>::type>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3, P4, P5, P6, P7, P8> type;
    };
 
-   template <template <class, std::size_t, class, class, class, class, class, class, class> class Cont  //6arg
-      , typename V, std::size_t N, typename A, class P0, class P1, class P2, class P3, class P4, class P5
-      , class U>
-      struct container_rebind<Cont<V, N, A, P0, P1, P2, P3, P4, P5>, U>
-   {
-      typedef Cont<U, N, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3, P4, P5> type;
-   };
+#endif   //!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
 
-   template <template <class, std::size_t, class, class, class, class, class, class, class, class> class Cont  //7arg
-      , typename V, std::size_t N, typename A, class P0, class P1, class P2, class P3, class P4, class P5, class P6
-      , class U>
-      struct container_rebind<Cont<V, N, A, P0, P1, P2, P3, P4, P5, P6>, U>
-   {
-      typedef Cont<U, N, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3, P4, P5, P6> type;
-   };
+   //for small_vector,static_vector
 
-   template <template <class, std::size_t, class, class, class, class, class, class, class, class, class> class Cont  //8arg
-      , typename V, std::size_t N, typename A, class P0, class P1, class P2, class P3, class P4, class P5, class P6, class P7
-      , class U>
-      struct container_rebind<Cont<V, N, A, P0, P1, P2, P3, P4, P5, P6, P7>, U>
+   template <typename V, std::size_t N, typename A, class U>
+   struct container_rebind<small_vector<V, N, A>, U>
    {
-      typedef Cont<U, N, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3, P4, P5, P6, P7> type;
+      typedef small_vector<U, N, typename allocator_traits<typename real_allocator<V, A>::type>::template portable_rebind_alloc<U>::type> type;
    };
 
-   template <template <class, std::size_t, class, class, class, class, class, class, class, class, class, class> class Cont  //9arg
-      , typename V, std::size_t N, typename A, class P0, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8
-      , class U>
-      struct container_rebind<Cont<V, N, A, P0, P1, P2, P3, P4, P5, P6, P7, P8>, U>
+   template <typename V, std::size_t N, typename O, class U>
+   struct container_rebind<static_vector<V, N, O>, U>
    {
-      typedef Cont<U, N, typename allocator_traits<A>::template portable_rebind_alloc<U>::type, P0, P1, P2, P3, P4, P5, P6, P7, P8> type;
+      typedef static_vector<U, N, O> type;
    };
 
-#endif   //!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
-
 }  //namespace dtl {
 }  //namespace container {
 }  //namespace boost {