Chris@16: // Copyright Peter Dimov and David Abrahams 2002. Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: #ifndef GET_POINTER_DWA20021219_HPP Chris@16: #define GET_POINTER_DWA20021219_HPP Chris@16: Chris@16: #include Chris@16: Chris@16: // In order to avoid circular dependencies with Boost.TR1 Chris@16: // we make sure that our include of doesn't try to Chris@16: // pull in the TR1 headers: that's why we use this header Chris@16: // rather than including directly: Chris@16: #include // std::auto_ptr Chris@16: Chris@16: namespace boost { Chris@16: Chris@16: // get_pointer(p) extracts a ->* capable pointer from p Chris@16: Chris@16: template T * get_pointer(T * p) Chris@16: { Chris@16: return p; Chris@16: } Chris@16: Chris@16: // get_pointer(shared_ptr const & p) has been moved to shared_ptr.hpp Chris@16: Chris@16: template T * get_pointer(std::auto_ptr const& p) Chris@16: { Chris@16: return p.get(); Chris@16: } Chris@16: Chris@16: #if !defined( BOOST_NO_CXX11_SMART_PTR ) Chris@16: Chris@16: template T * get_pointer( std::unique_ptr const& p ) Chris@16: { Chris@16: return p.get(); Chris@16: } Chris@16: Chris@16: template T * get_pointer( std::shared_ptr const& p ) Chris@16: { Chris@16: return p.get(); Chris@16: } Chris@16: Chris@16: #endif Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: #endif // GET_POINTER_DWA20021219_HPP