Skip to content

Commit

Permalink
Switch to allocator_traits from Boost.Core.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lastique committed Oct 1, 2023
1 parent a0811c2 commit 9cb9046
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions include/boost/log/detail/allocator_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
#include <memory>
#include <boost/log/detail/config.hpp>
#if defined(BOOST_NO_CXX11_ALLOCATOR)
#include <boost/container/allocator_traits.hpp>
#include <boost/core/allocator_access.hpp>
#include <boost/core/allocator_traits.hpp>
#endif
#include <boost/log/utility/use_std_allocator.hpp>
#include <boost/log/detail/header.hpp>
Expand All @@ -38,23 +39,22 @@ namespace aux {
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
using std::allocator_traits;
#else
using boost::container::allocator_traits;
using boost::allocator_traits;
#endif

/*!
* \brief A standalone trait to rebind an allocator to another type.
*
* The important difference from <tt>std::allocator_traits&lt;Alloc&gt;::rebind_alloc&lt;U&gt;</tt> is that this
* trait does not require template aliases and thus is compatible with C++03. There is
* <tt>boost::container::allocator_traits&lt;Alloc&gt;::portable_rebind_alloc&lt;U&gt;</tt>, but it is not present in <tt>std::allocator_traits</tt>.
* This trait mostly exists to hide differences between <tt>std::allocator_traits</tt> and <tt>boost::allocator_traits</tt>
* in terms of allocator rebinding and also provide custom behavior in some cases.
*/
template< typename Allocator, typename U >
struct rebind_alloc
{
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
typedef typename std::allocator_traits< Allocator >::BOOST_NESTED_TEMPLATE rebind_alloc< U > type;
#else
typedef typename boost::container::allocator_traits< Allocator >::BOOST_NESTED_TEMPLATE portable_rebind_alloc< U >::type type;
typedef typename boost::allocator_rebind< Allocator, U >::type type;
#endif
};

Expand Down

0 comments on commit 9cb9046

Please sign in to comment.