]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/smart_ptr/enable_shared_from.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / smart_ptr / enable_shared_from.hpp
1 #ifndef BOOST_SMART_PTR_ENABLE_SHARED_FROM_HPP_INCLUDED
2 #define BOOST_SMART_PTR_ENABLE_SHARED_FROM_HPP_INCLUDED
3
4 // enable_shared_from.hpp
5 //
6 // Copyright 2019 Peter Dimov
7 //
8 // Distributed under the Boost Software License, Version 1.0.
9 // See accompanying file LICENSE_1_0.txt or copy at
10 // http://www.boost.org/LICENSE_1_0.txt
11 //
12 // See http://www.boost.org/libs/smart_ptr/ for documentation.
13
14 #include <boost/smart_ptr/enable_shared_from_this.hpp>
15 #include <boost/smart_ptr/detail/sp_noexcept.hpp>
16
17 namespace boost
18 {
19
20 class enable_shared_from: public enable_shared_from_this<enable_shared_from>
21 {
22 };
23
24
25 template<class T> shared_ptr<T> shared_from( T * p )
26 {
27 return shared_ptr<T>( p->enable_shared_from::shared_from_this(), p );
28 }
29
30 template<class T> weak_ptr<T> weak_from( T * p ) BOOST_SP_NOEXCEPT
31 {
32 return weak_ptr<T>( p->enable_shared_from::weak_from_this(), p );
33 }
34
35 } // namespace boost
36
37 #endif // #ifndef BOOST_SMART_PTR_ENABLE_SHARED_FROM_HPP_INCLUDED