]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/asio/detail/memory.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / asio / detail / memory.hpp
CommitLineData
b32b8144
FG
1//
2// detail/memory.hpp
3// ~~~~~~~~~~~~~~~~~
4//
f67539c2 5// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
b32b8144
FG
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
11#ifndef BOOST_ASIO_DETAIL_MEMORY_HPP
12#define BOOST_ASIO_DETAIL_MEMORY_HPP
13
14#if defined(_MSC_VER) && (_MSC_VER >= 1200)
15# pragma once
16#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17
18#include <boost/asio/detail/config.hpp>
19#include <memory>
20
21#if !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
20effc67 22# include <boost/make_shared.hpp>
b32b8144
FG
23# include <boost/shared_ptr.hpp>
24# include <boost/weak_ptr.hpp>
25#endif // !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
26
27#if !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
28# include <boost/utility/addressof.hpp>
29#endif // !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
30
31namespace boost {
32namespace asio {
33namespace detail {
34
35#if defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
20effc67 36using std::make_shared;
b32b8144
FG
37using std::shared_ptr;
38using std::weak_ptr;
39#else // defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
20effc67 40using boost::make_shared;
b32b8144
FG
41using boost::shared_ptr;
42using boost::weak_ptr;
43#endif // defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
44
45#if defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
46using std::addressof;
47#else // defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
48using boost::addressof;
49#endif // defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
50
51} // namespace detail
52
53#if defined(BOOST_ASIO_HAS_CXX11_ALLOCATORS)
54using std::allocator_arg_t;
55# define BOOST_ASIO_USES_ALLOCATOR(t) \
56 namespace std { \
57 template <typename Allocator> \
58 struct uses_allocator<t, Allocator> : true_type {}; \
59 } \
60 /**/
61# define BOOST_ASIO_REBIND_ALLOC(alloc, t) \
62 typename std::allocator_traits<alloc>::template rebind_alloc<t>
63 /**/
64#else // defined(BOOST_ASIO_HAS_CXX11_ALLOCATORS)
65struct allocator_arg_t {};
66# define BOOST_ASIO_USES_ALLOCATOR(t)
67# define BOOST_ASIO_REBIND_ALLOC(alloc, t) \
68 typename alloc::template rebind<t>::other
69 /**/
70#endif // defined(BOOST_ASIO_HAS_CXX11_ALLOCATORS)
71
72} // namespace asio
73} // namespace boost
74
75#endif // BOOST_ASIO_DETAIL_MEMORY_HPP