Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

memory.hpp 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // detail/memory.hpp
  3. // ~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. #ifndef ASIO_DETAIL_MEMORY_HPP
  11. #define ASIO_DETAIL_MEMORY_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include "asio/detail/config.hpp"
  16. #include <memory>
  17. #if !defined(ASIO_HAS_STD_SHARED_PTR)
  18. # include <boost/shared_ptr.hpp>
  19. # include <boost/weak_ptr.hpp>
  20. #endif // !defined(ASIO_HAS_STD_SHARED_PTR)
  21. #if !defined(ASIO_HAS_STD_ADDRESSOF)
  22. # include <boost/utility/addressof.hpp>
  23. #endif // !defined(ASIO_HAS_STD_ADDRESSOF)
  24. namespace asio {
  25. namespace detail {
  26. #if defined(ASIO_HAS_STD_SHARED_PTR)
  27. using std::shared_ptr;
  28. using std::weak_ptr;
  29. #else // defined(ASIO_HAS_STD_SHARED_PTR)
  30. using boost::shared_ptr;
  31. using boost::weak_ptr;
  32. #endif // defined(ASIO_HAS_STD_SHARED_PTR)
  33. #if defined(ASIO_HAS_STD_ADDRESSOF)
  34. using std::addressof;
  35. #else // defined(ASIO_HAS_STD_ADDRESSOF)
  36. using boost::addressof;
  37. #endif // defined(ASIO_HAS_STD_ADDRESSOF)
  38. } // namespace detail
  39. #if defined(ASIO_HAS_CXX11_ALLOCATORS)
  40. using std::allocator_arg_t;
  41. # define ASIO_USES_ALLOCATOR(t) \
  42. namespace std { \
  43. template <typename Allocator> \
  44. struct uses_allocator<t, Allocator> : true_type {}; \
  45. } \
  46. /**/
  47. # define ASIO_REBIND_ALLOC(alloc, t) \
  48. typename std::allocator_traits<alloc>::template rebind_alloc<t>
  49. /**/
  50. #else // defined(ASIO_HAS_CXX11_ALLOCATORS)
  51. struct allocator_arg_t {};
  52. # define ASIO_USES_ALLOCATOR(t)
  53. # define ASIO_REBIND_ALLOC(alloc, t) \
  54. typename alloc::template rebind<t>::other
  55. /**/
  56. #endif // defined(ASIO_HAS_CXX11_ALLOCATORS)
  57. } // namespace asio
  58. #endif // ASIO_DETAIL_MEMORY_HPP