From b9dceb23401a9917257e5ecc89575c161ee1c0d2 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 26 Aug 2002 15:27:23 +0000 Subject: [PATCH] *_ptr.hpp: - Added detail::is_pointerlike_helper function templates for Signals weak_ptr.hpp: - Added get_pointer function template for weak_ptr [SVN r15099] --- include/boost/intrusive_ptr.hpp | 6 ++++++ include/boost/scoped_ptr.hpp | 6 ++++++ include/boost/shared_ptr.hpp | 7 +++++++ include/boost/weak_ptr.hpp | 13 +++++++++++++ 4 files changed, 32 insertions(+) diff --git a/include/boost/intrusive_ptr.hpp b/include/boost/intrusive_ptr.hpp index 4ada734..0a62544 100644 --- a/include/boost/intrusive_ptr.hpp +++ b/include/boost/intrusive_ptr.hpp @@ -193,6 +193,12 @@ template T * get_pointer(intrusive_ptr const & p) return p.get(); } +namespace detail { + // is_pointerlike_helper enables Signals library to recognize intrusive_ptr + template + type_traits::yes_type is_pointerlike_helper(const intrusive_ptr&, int); +} // end namespace detail + } // namespace boost #ifdef BOOST_MSVC diff --git a/include/boost/scoped_ptr.hpp b/include/boost/scoped_ptr.hpp index 738ad1b..7adc0e8 100644 --- a/include/boost/scoped_ptr.hpp +++ b/include/boost/scoped_ptr.hpp @@ -119,6 +119,12 @@ template inline T * get_pointer(scoped_ptr const & p) return p.get(); } +namespace detail { + // is_pointerlike_helper enables Signals library to recognize scoped_ptr + template + type_traits::yes_type is_pointerlike_helper(const scoped_ptr&, int); +} // end namespace detail + } // namespace boost #endif // #ifndef BOOST_SCOPED_PTR_HPP_INCLUDED diff --git a/include/boost/shared_ptr.hpp b/include/boost/shared_ptr.hpp index 8f55948..d9cc25d 100644 --- a/include/boost/shared_ptr.hpp +++ b/include/boost/shared_ptr.hpp @@ -25,6 +25,7 @@ #include #include #include +#include #include // for std::auto_ptr #include // for std::swap @@ -323,6 +324,12 @@ template inline T * get_pointer(shared_ptr const & p) return p.get(); } +namespace detail { + // is_pointerlike_helper enables Signals library to recognize shared_ptr + template + type_traits::yes_type is_pointerlike_helper(const shared_ptr&, int); +} // end namespace detail + // shared_from_this() creates a shared_ptr from a raw pointer (usually 'this') namespace detail diff --git a/include/boost/weak_ptr.hpp b/include/boost/weak_ptr.hpp index e04b4f1..dc11ca0 100644 --- a/include/boost/weak_ptr.hpp +++ b/include/boost/weak_ptr.hpp @@ -168,6 +168,19 @@ template shared_ptr make_shared(weak_ptr const & r) // never thro } } +// mem_fn support + +template T * get_pointer(weak_ptr const & p) +{ + return p.get(); +} + +namespace detail { + // is_pointerlike_helper enables Signals library to recognize intrusive_ptr + template + type_traits::yes_type is_pointerlike_helper(const weak_ptr&, int); +} // end namespace detail + } // namespace boost #ifdef BOOST_MSVC