mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-07-31 21:24:40 +02:00
*_ptr.hpp:
- Added detail::is_pointerlike_helper function templates for Signals weak_ptr.hpp: - Added get_pointer function template for weak_ptr [SVN r15099]
This commit is contained in:
@@ -193,6 +193,12 @@ template<class T> T * get_pointer(intrusive_ptr<T> const & p)
|
|||||||
return p.get();
|
return p.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace detail {
|
||||||
|
// is_pointerlike_helper enables Signals library to recognize intrusive_ptr
|
||||||
|
template<typename T>
|
||||||
|
type_traits::yes_type is_pointerlike_helper(const intrusive_ptr<T>&, int);
|
||||||
|
} // end namespace detail
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#ifdef BOOST_MSVC
|
#ifdef BOOST_MSVC
|
||||||
|
@@ -119,6 +119,12 @@ template<typename T> inline T * get_pointer(scoped_ptr<T> const & p)
|
|||||||
return p.get();
|
return p.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace detail {
|
||||||
|
// is_pointerlike_helper enables Signals library to recognize scoped_ptr
|
||||||
|
template<typename T>
|
||||||
|
type_traits::yes_type is_pointerlike_helper(const scoped_ptr<T>&, int);
|
||||||
|
} // end namespace detail
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#endif // #ifndef BOOST_SCOPED_PTR_HPP_INCLUDED
|
#endif // #ifndef BOOST_SCOPED_PTR_HPP_INCLUDED
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
#include <boost/checked_delete.hpp>
|
#include <boost/checked_delete.hpp>
|
||||||
#include <boost/throw_exception.hpp>
|
#include <boost/throw_exception.hpp>
|
||||||
#include <boost/detail/shared_count.hpp>
|
#include <boost/detail/shared_count.hpp>
|
||||||
|
#include <boost/type_traits/ice.hpp>
|
||||||
|
|
||||||
#include <memory> // for std::auto_ptr
|
#include <memory> // for std::auto_ptr
|
||||||
#include <algorithm> // for std::swap
|
#include <algorithm> // for std::swap
|
||||||
@@ -323,6 +324,12 @@ template<typename T> inline T * get_pointer(shared_ptr<T> const & p)
|
|||||||
return p.get();
|
return p.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace detail {
|
||||||
|
// is_pointerlike_helper enables Signals library to recognize shared_ptr
|
||||||
|
template<typename T>
|
||||||
|
type_traits::yes_type is_pointerlike_helper(const shared_ptr<T>&, int);
|
||||||
|
} // end namespace detail
|
||||||
|
|
||||||
// shared_from_this() creates a shared_ptr from a raw pointer (usually 'this')
|
// shared_from_this() creates a shared_ptr from a raw pointer (usually 'this')
|
||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
|
@@ -168,6 +168,19 @@ template<class T> shared_ptr<T> make_shared(weak_ptr<T> const & r) // never thro
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mem_fn support
|
||||||
|
|
||||||
|
template<class T> T * get_pointer(weak_ptr<T> const & p)
|
||||||
|
{
|
||||||
|
return p.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace detail {
|
||||||
|
// is_pointerlike_helper enables Signals library to recognize intrusive_ptr
|
||||||
|
template<typename T>
|
||||||
|
type_traits::yes_type is_pointerlike_helper(const weak_ptr<T>&, int);
|
||||||
|
} // end namespace detail
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
||||||
#ifdef BOOST_MSVC
|
#ifdef BOOST_MSVC
|
||||||
|
Reference in New Issue
Block a user