to_raw_pointer.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2017-2017
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // See http://www.boost.org/libs/move for documentation.
  10. //
  11. /////////////////////////////////////////////////////////////////////////////
  12. #ifndef BOOST_MOVE_DETAIL_TO_RAW_POINTER_HPP
  13. #define BOOST_MOVE_DETAIL_TO_RAW_POINTER_HPP
  14. #ifndef BOOST_CONFIG_HPP
  15. # include <boost/config.hpp>
  16. #endif
  17. #if defined(BOOST_HAS_PRAGMA_ONCE)
  18. # pragma once
  19. #endif
  20. #include <boost/move/detail/config_begin.hpp>
  21. #include <boost/move/detail/workaround.hpp>
  22. #include <boost/move/detail/pointer_element.hpp>
  23. namespace boost {
  24. namespace movelib {
  25. template <class T>
  26. BOOST_MOVE_FORCEINLINE T* to_raw_pointer(T* p)
  27. { return p; }
  28. template <class Pointer>
  29. BOOST_MOVE_FORCEINLINE typename boost::movelib::pointer_element<Pointer>::type*
  30. to_raw_pointer(const Pointer &p)
  31. { return ::boost::movelib::to_raw_pointer(p.operator->()); }
  32. } //namespace movelib
  33. } //namespace boost
  34. #include <boost/move/detail/config_end.hpp>
  35. #endif //BOOST_MOVE_DETAIL_TO_RAW_POINTER_HPP