File indexing completed on 2025-12-15 10:10:39
0001
0002
0003
0004
0005 #ifndef GET_POINTER_DWA20021219_HPP
0006 #define GET_POINTER_DWA20021219_HPP
0007
0008 #include <boost/config.hpp>
0009
0010
0011
0012
0013
0014 #include <boost/config/no_tr1/memory.hpp> // std::auto_ptr
0015
0016 namespace boost {
0017
0018
0019
0020 template<class T> T * get_pointer(T * p)
0021 {
0022 return p;
0023 }
0024
0025
0026
0027 #if !defined( BOOST_NO_AUTO_PTR )
0028
0029 #if defined( __GNUC__ ) && (defined( __GXX_EXPERIMENTAL_CXX0X__ ) || (__cplusplus >= 201103L))
0030 #if defined( BOOST_GCC )
0031 #if BOOST_GCC >= 40600
0032 #define BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS
0033 #endif
0034 #elif defined( __clang__ ) && defined( __has_warning )
0035 #if __has_warning("-Wdeprecated-declarations")
0036 #define BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS
0037 #endif
0038 #endif
0039 #endif
0040
0041 #if defined( BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS )
0042
0043 #pragma GCC diagnostic push
0044 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
0045 #define BOOST_CORE_DETAIL_DISABLED_DEPRECATED_WARNINGS
0046 #endif
0047
0048 template<class T> T * get_pointer(std::auto_ptr<T> const& p)
0049 {
0050 return p.get();
0051 }
0052
0053 #if defined( BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS )
0054 #pragma GCC diagnostic pop
0055 #undef BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS
0056 #endif
0057
0058 #endif
0059
0060 #if !defined( BOOST_NO_CXX11_SMART_PTR )
0061
0062 template<class T> T * get_pointer( std::unique_ptr<T> const& p )
0063 {
0064 return p.get();
0065 }
0066
0067 template<class T> T * get_pointer( std::shared_ptr<T> const& p )
0068 {
0069 return p.get();
0070 }
0071
0072 #endif
0073
0074 }
0075
0076 #endif