Chris@16
|
1 // (C) Copyright John Maddock 2005.
|
Chris@16
|
2 // Use, modification and distribution are subject to the
|
Chris@16
|
3 // Boost Software License, Version 1.0. (See accompanying file
|
Chris@16
|
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
5
|
Chris@16
|
6 #ifndef BOOST_TR1_MEMORY_HPP_INCLUDED
|
Chris@16
|
7 # define BOOST_TR1_MEMORY_HPP_INCLUDED
|
Chris@16
|
8 # include <boost/tr1/detail/config.hpp>
|
Chris@16
|
9 # include <boost/detail/workaround.hpp>
|
Chris@16
|
10 # include <memory>
|
Chris@16
|
11
|
Chris@16
|
12 #ifndef BOOST_HAS_TR1_SHARED_PTR
|
Chris@16
|
13
|
Chris@16
|
14 //
|
Chris@16
|
15 // This header can get included by boost/shared_ptr.hpp which leads
|
Chris@16
|
16 // to cyclic dependencies, the workaround is to forward declare all
|
Chris@16
|
17 // the boost components, and then include the actual headers afterwards.
|
Chris@16
|
18 // This is fragile, but seems to work, and doesn't require modification
|
Chris@16
|
19 // of boost/shared_ptr.hpp.
|
Chris@16
|
20 //
|
Chris@16
|
21 namespace boost{
|
Chris@16
|
22
|
Chris@16
|
23 class bad_weak_ptr;
|
Chris@16
|
24 template<class T> class weak_ptr;
|
Chris@16
|
25 template<class T> class shared_ptr;
|
Chris@16
|
26 template<class T> void swap(weak_ptr<T> & a, weak_ptr<T> & b) BOOST_NOEXCEPT;
|
Chris@16
|
27 template<class T> void swap(shared_ptr<T> & a, shared_ptr<T> & b) BOOST_NOEXCEPT;
|
Chris@16
|
28 template<class T, class U> shared_ptr<T> static_pointer_cast(shared_ptr<U> const & r) BOOST_NOEXCEPT;
|
Chris@16
|
29 template<class T, class U> shared_ptr<T> dynamic_pointer_cast(shared_ptr<U> const & r) BOOST_NOEXCEPT;
|
Chris@16
|
30 template<class T, class U> shared_ptr<T> const_pointer_cast(shared_ptr<U> const & r) BOOST_NOEXCEPT;
|
Chris@16
|
31 template<class D, class T> D * get_deleter(shared_ptr<T> const & p) BOOST_NOEXCEPT;
|
Chris@16
|
32 template<class T> class enable_shared_from_this;
|
Chris@16
|
33
|
Chris@16
|
34 namespace detail{
|
Chris@16
|
35 class shared_count;
|
Chris@16
|
36 class weak_count;
|
Chris@16
|
37 }
|
Chris@16
|
38
|
Chris@16
|
39 }
|
Chris@16
|
40
|
Chris@16
|
41 namespace std{ namespace tr1{
|
Chris@16
|
42
|
Chris@16
|
43 using ::boost::bad_weak_ptr;
|
Chris@16
|
44 using ::boost::shared_ptr;
|
Chris@16
|
45 #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
|
Chris@16
|
46 using ::boost::swap;
|
Chris@16
|
47 #endif
|
Chris@16
|
48 using ::boost::static_pointer_cast;
|
Chris@16
|
49 using ::boost::dynamic_pointer_cast;
|
Chris@16
|
50 using ::boost::const_pointer_cast;
|
Chris@16
|
51 using ::boost::get_deleter;
|
Chris@16
|
52 using ::boost::weak_ptr;
|
Chris@16
|
53 using ::boost::enable_shared_from_this;
|
Chris@16
|
54
|
Chris@16
|
55 } }
|
Chris@16
|
56 #include <boost/shared_ptr.hpp>
|
Chris@16
|
57 #include <boost/weak_ptr.hpp>
|
Chris@16
|
58 #include <boost/enable_shared_from_this.hpp>
|
Chris@16
|
59
|
Chris@16
|
60 #else
|
Chris@16
|
61
|
Chris@16
|
62 # if defined(BOOST_HAS_INCLUDE_NEXT) && !defined(BOOST_TR1_DISABLE_INCLUDE_NEXT)
|
Chris@16
|
63 # include_next BOOST_TR1_HEADER(memory)
|
Chris@16
|
64 # else
|
Chris@16
|
65 # include <boost/tr1/detail/config_all.hpp>
|
Chris@16
|
66 # include BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(memory))
|
Chris@16
|
67 # endif
|
Chris@16
|
68
|
Chris@16
|
69 #endif
|
Chris@16
|
70
|
Chris@16
|
71 #endif
|
Chris@16
|
72
|