Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 10:10:39

0001 // Copyright Peter Dimov and David Abrahams 2002.
0002 // Distributed under the Boost Software License, Version 1.0. (See
0003 // accompanying file LICENSE_1_0.txt or copy at
0004 // http://www.boost.org/LICENSE_1_0.txt)
0005 #ifndef GET_POINTER_DWA20021219_HPP
0006 #define GET_POINTER_DWA20021219_HPP
0007 
0008 #include <boost/config.hpp>
0009 
0010 // In order to avoid circular dependencies with Boost.TR1
0011 // we make sure that our include of <memory> doesn't try to
0012 // pull in the TR1 headers: that's why we use this header 
0013 // rather than including <memory> directly:
0014 #include <boost/config/no_tr1/memory.hpp>  // std::auto_ptr
0015 
0016 namespace boost { 
0017 
0018 // get_pointer(p) extracts a ->* capable pointer from p
0019 
0020 template<class T> T * get_pointer(T * p)
0021 {
0022     return p;
0023 }
0024 
0025 // get_pointer(shared_ptr<T> const & p) has been moved to shared_ptr.hpp
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 // BOOST_GCC >= 40600
0034 #elif defined( __clang__ ) && defined( __has_warning )
0035 #if __has_warning("-Wdeprecated-declarations")
0036 #define BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS
0037 #endif // __has_warning("-Wdeprecated-declarations")
0038 #endif
0039 #endif // defined( __GNUC__ ) && (defined( __GXX_EXPERIMENTAL_CXX0X__ ) || (__cplusplus >= 201103L))
0040 
0041 #if defined( BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS )
0042 // Disable libstdc++ warnings about std::auto_ptr being deprecated in C++11 mode
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 // !defined( BOOST_NO_AUTO_PTR )
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 } // namespace boost
0075 
0076 #endif // GET_POINTER_DWA20021219_HPP