00001 // Copyright Peter Dimov and David Abrahams 2002. 00002 // Distributed under the Boost Software License, Version 1.0. (See 00003 // accompanying file LICENSE_1_0.txt or copy at 00004 // http://www.boost.org/LICENSE_1_0.txt) 00005 #ifndef GET_POINTER_DWA20021219_HPP 00006 # define GET_POINTER_DWA20021219_HPP 00007 00008 # include <memory> 00009 00010 namespace boost { 00011 00012 // get_pointer(p) extracts a ->* capable pointer from p 00013 00014 template<class T> T * get_pointer(T * p) 00015 { 00016 return p; 00017 } 00018 00019 // get_pointer(shared_ptr<T> const & p) has been moved to shared_ptr.hpp 00020 00021 template<class T> T * get_pointer(std::auto_ptr<T> const& p) 00022 { 00023 return p.get(); 00024 } 00025 00026 00027 } // namespace boost 00028 00029 #endif // GET_POINTER_DWA20021219_HPP
1.5.5