allocator.hpp 945 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // Official repository: https://github.com/boostorg/beast
  8. //
  9. #ifndef BOOST_BEAST_DETAIL_ALLOCATOR_HPP
  10. #define BOOST_BEAST_DETAIL_ALLOCATOR_HPP
  11. #include <boost/config.hpp>
  12. #ifdef BOOST_NO_CXX11_ALLOCATOR
  13. #include <boost/container/allocator_traits.hpp>
  14. #else
  15. #include <memory>
  16. #endif
  17. namespace boost {
  18. namespace beast {
  19. namespace detail {
  20. // This is a workaround for allocator_traits
  21. // implementations which falsely claim C++11
  22. // compatibility.
  23. #ifdef BOOST_NO_CXX11_ALLOCATOR
  24. template<class Alloc>
  25. using allocator_traits = boost::container::allocator_traits<Alloc>;
  26. #else
  27. template<class Alloc>
  28. using allocator_traits = std::allocator_traits<Alloc>;
  29. #endif
  30. } // detail
  31. } // beast
  32. } // boost
  33. #endif