1 //////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Ion Gaztanaga 2017-2017. Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // See http://www.boost.org/libs/container for documentation.
9 //////////////////////////////////////////////////////////////////////////////
10 #ifndef BOOST_CONTAINER_DETAIL_CONTAINER_OR_ALLOCATOR_REBIND_HPP
11 #define BOOST_CONTAINER_DETAIL_CONTAINER_OR_ALLOCATOR_REBIND_HPP
13 #ifndef BOOST_CONFIG_HPP
14 # include <boost/config.hpp>
17 #if defined(BOOST_HAS_PRAGMA_ONCE)
21 #include <boost/container/allocator_traits.hpp>
22 #include <boost/container/detail/container_rebind.hpp>
23 #include <boost/container/detail/is_container.hpp>
27 namespace container_detail {
29 template<class AllocatorOrContainer, class ToType, bool = is_container<AllocatorOrContainer>::value>
30 struct container_or_allocator_rebind_impl
31 : container_rebind<AllocatorOrContainer, ToType>
34 template<class AllocatorOrContainer, class ToType>
35 struct container_or_allocator_rebind_impl<AllocatorOrContainer, ToType, false>
36 : allocator_traits<AllocatorOrContainer>::template portable_rebind_alloc<ToType>
40 template<class AllocatorOrContainer, class ToType>
41 struct container_or_allocator_rebind
42 : container_or_allocator_rebind_impl<AllocatorOrContainer, ToType>
45 } //namespace container_detail {
46 } //namespace container {
49 #endif //#ifndef BOOST_CONTAINER_DETAIL_CONTAINER_OR_ALLOCATOR_REBIND_HPP