BVB Source Codes

mars Show get_pointer.hpp Source code

Return Download mars: download get_pointer.hpp Source code - Download mars Source code - Type:.hpp
  1. // Copyright Peter Dimov and David Abrahams 2002.
  2. // Distributed under the Boost Software License, Version 1.0. (See
  3. // accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef GET_POINTER_DWA20021219_HPP
  6. #define GET_POINTER_DWA20021219_HPP
  7.  
  8. #include <boost/config.hpp>
  9.  
  10. // In order to avoid circular dependencies with Boost.TR1
  11. // we make sure that our include of <memory> doesn't try to
  12. // pull in the TR1 headers: that's why we use this header
  13. // rather than including <memory> directly:
  14. #include <boost/config/no_tr1/memory.hpp>  // std::auto_ptr
  15.  
  16. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost {
  17.  
  18. // get_pointer(p) extracts a ->* capable pointer from p
  19.  
  20. template<class T> T * get_pointer(T * p)
  21. {
  22.     return p;
  23. }
  24.  
  25. // get_pointer(shared_ptr<T> const & p) has been moved to shared_ptr.hpp
  26.  
  27. #if !defined( BOOST_NO_AUTO_PTR )
  28.  
  29. #if defined( __GNUC__ ) && (defined( __GXX_EXPERIMENTAL_CXX0X__ ) || (__cplusplus >= 201103L))
  30. #if defined( BOOST_GCC )
  31. #if BOOST_GCC >= 40600
  32. #define BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS
  33. #endif // BOOST_GCC >= 40600
  34. #elif defined( __clang__ ) && defined( __has_warning )
  35. #if __has_warning("-Wdeprecated-declarations")
  36. #define BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS
  37. #endif // __has_warning("-Wdeprecated-declarations")
  38. #endif
  39. #endif // defined( __GNUC__ ) && (defined( __GXX_EXPERIMENTAL_CXX0X__ ) || (__cplusplus >= 201103L))
  40.  
  41. #if defined( BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS )
  42. // Disable libstdc++ warnings about std::auto_ptr being deprecated in C++11 mode
  43. #pragma GCC diagnostic push
  44. #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
  45. #define BOOST_CORE_DETAIL_DISABLED_DEPRECATED_WARNINGS
  46. #endif
  47.  
  48. template<class T> T * get_pointer(std::auto_ptr<T> const& p)
  49. {
  50.     return p.get();
  51. }
  52.  
  53. #if defined( BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS )
  54. #pragma GCC diagnostic pop
  55. #undef BOOST_CORE_DETAIL_DISABLE_LIBSTDCXX_DEPRECATED_WARNINGS
  56. #endif
  57.  
  58. #endif // !defined( BOOST_NO_AUTO_PTR )
  59.  
  60. #if !defined( BOOST_NO_CXX11_SMART_PTR )
  61.  
  62. template<class T> T * get_pointer( std::unique_ptr<T> const& p )
  63. {
  64.     return p.get();
  65. }
  66.  
  67. template<class T> T * get_pointer( std::shared_ptr<T> const& p )
  68. {
  69.     return p.get();
  70. }
  71.  
  72. #endif
  73.  
  74. } // namespace mars_boost
  75.  
  76. #endif // GET_POINTER_DWA20021219_HPP
  77.  
downloadget_pointer.hpp Source code - Download mars Source code
Related Source Codes/Software:
Hero - Elegant transition library for iOS & tvOS 2017-06-09
deep-photo-styletransfer - Code and data for paper "Deep Photo Style Transfer... 2017-06-09
mastodon - A GNU Social-compatible microblogging server ... 2017-06-09
plyr - A simple HTML5, YouTube and Vimeo player ... 2017-06-08
prepack - Prepack is a partial evaluator for JavaScript. Pre... 2017-06-08
Public-APIs - 2017-06-09
lottie-ios - An iOS library to natively render After Effects ve... 2017-06-09
Awesome-Hacking - A collection of various awesome lists for hackers,... 2017-06-09
algorithms - Minimal examples of data structures and algorithms... 2017-06-10
lectures - Oxford Deep NLP 2017 course 2017-06-10
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top