]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/asio/detail/memory.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / asio / detail / memory.hpp
1 //
2 // detail/memory.hpp
3 // ~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2017 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
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)
22 # include <boost/shared_ptr.hpp>
23 # include <boost/weak_ptr.hpp>
24 #endif // !defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
25
26 #if !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
27 # include <boost/utility/addressof.hpp>
28 #endif // !defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
29
30 namespace boost {
31 namespace asio {
32 namespace detail {
33
34 #if defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
35 using std::shared_ptr;
36 using std::weak_ptr;
37 #else // defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
38 using boost::shared_ptr;
39 using boost::weak_ptr;
40 #endif // defined(BOOST_ASIO_HAS_STD_SHARED_PTR)
41
42 #if defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
43 using std::addressof;
44 #else // defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
45 using boost::addressof;
46 #endif // defined(BOOST_ASIO_HAS_STD_ADDRESSOF)
47
48 } // namespace detail
49
50 #if defined(BOOST_ASIO_HAS_CXX11_ALLOCATORS)
51 using std::allocator_arg_t;
52 # define BOOST_ASIO_USES_ALLOCATOR(t) \
53 namespace std { \
54 template <typename Allocator> \
55 struct uses_allocator<t, Allocator> : true_type {}; \
56 } \
57 /**/
58 # define BOOST_ASIO_REBIND_ALLOC(alloc, t) \
59 typename std::allocator_traits<alloc>::template rebind_alloc<t>
60 /**/
61 #else // defined(BOOST_ASIO_HAS_CXX11_ALLOCATORS)
62 struct allocator_arg_t {};
63 # define BOOST_ASIO_USES_ALLOCATOR(t)
64 # define BOOST_ASIO_REBIND_ALLOC(alloc, t) \
65 typename alloc::template rebind<t>::other
66 /**/
67 #endif // defined(BOOST_ASIO_HAS_CXX11_ALLOCATORS)
68
69 } // namespace asio
70 } // namespace boost
71
72 #endif // BOOST_ASIO_DETAIL_MEMORY_HPP