force_ptr.hpp 956 B

123456789101112131415161718192021222324252627282930313233343536
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2014-2015. Distributed under the Boost
  4. // Software License, Version 1.0. (See accompanying file
  5. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/libs/container for documentation.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. #ifndef BOOST_MOVE_DETAIL_FORCE_CAST_HPP
  11. #define BOOST_MOVE_DETAIL_FORCE_CAST_HPP
  12. #ifndef BOOST_CONFIG_HPP
  13. # include <boost/config.hpp>
  14. #endif
  15. #if defined(BOOST_HAS_PRAGMA_ONCE)
  16. # pragma once
  17. #endif
  18. #include <boost/move/detail/workaround.hpp>
  19. namespace boost {
  20. namespace move_detail {
  21. template <typename T>
  22. BOOST_MOVE_FORCEINLINE T force_ptr(const volatile void *p)
  23. {
  24. return static_cast<T>(const_cast<void*>(p));
  25. }
  26. } //namespace move_detail {
  27. } //namespace boost {
  28. #endif //#ifndef BOOST_MOVE_DETAIL_FORCE_CAST_HPP