annotate DEPENDENCIES/generic/include/boost/get_pointer.hpp @ 125:34e428693f5d vext

Vext -> Repoint
author Chris Cannam
date Thu, 14 Jun 2018 11:15:39 +0100
parents 2665513ce2d3
children
rev   line source
Chris@16 1 // Copyright Peter Dimov and David Abrahams 2002.
Chris@16 2 // Distributed under the Boost Software License, Version 1.0. (See
Chris@16 3 // accompanying file LICENSE_1_0.txt or copy at
Chris@16 4 // http://www.boost.org/LICENSE_1_0.txt)
Chris@16 5 #ifndef GET_POINTER_DWA20021219_HPP
Chris@16 6 #define GET_POINTER_DWA20021219_HPP
Chris@16 7
Chris@16 8 #include <boost/config.hpp>
Chris@16 9
Chris@16 10 // In order to avoid circular dependencies with Boost.TR1
Chris@16 11 // we make sure that our include of <memory> doesn't try to
Chris@16 12 // pull in the TR1 headers: that's why we use this header
Chris@16 13 // rather than including <memory> directly:
Chris@16 14 #include <boost/config/no_tr1/memory.hpp> // std::auto_ptr
Chris@16 15
Chris@16 16 namespace boost {
Chris@16 17
Chris@16 18 // get_pointer(p) extracts a ->* capable pointer from p
Chris@16 19
Chris@16 20 template<class T> T * get_pointer(T * p)
Chris@16 21 {
Chris@16 22 return p;
Chris@16 23 }
Chris@16 24
Chris@16 25 // get_pointer(shared_ptr<T> const & p) has been moved to shared_ptr.hpp
Chris@16 26
Chris@16 27 template<class T> T * get_pointer(std::auto_ptr<T> const& p)
Chris@16 28 {
Chris@16 29 return p.get();
Chris@16 30 }
Chris@16 31
Chris@16 32 #if !defined( BOOST_NO_CXX11_SMART_PTR )
Chris@16 33
Chris@16 34 template<class T> T * get_pointer( std::unique_ptr<T> const& p )
Chris@16 35 {
Chris@16 36 return p.get();
Chris@16 37 }
Chris@16 38
Chris@16 39 template<class T> T * get_pointer( std::shared_ptr<T> const& p )
Chris@16 40 {
Chris@16 41 return p.get();
Chris@16 42 }
Chris@16 43
Chris@16 44 #endif
Chris@16 45
Chris@16 46 } // namespace boost
Chris@16 47
Chris@16 48 #endif // GET_POINTER_DWA20021219_HPP