force_ptr.hpp 948 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 BHO_MOVE_DETAIL_FORCE_CAST_HPP
  11. #define BHO_MOVE_DETAIL_FORCE_CAST_HPP
  12. #ifndef BHO_CONFIG_HPP
  13. # include <asio2/bho/config.hpp>
  14. #endif
  15. #if defined(BHO_HAS_PRAGMA_ONCE)
  16. # pragma once
  17. #endif
  18. #include <asio2/bho/move/detail/workaround.hpp>
  19. namespace bho {
  20. namespace move_detail {
  21. template <typename T>
  22. BHO_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 bho {
  28. #endif //#ifndef BHO_MOVE_DETAIL_FORCE_CAST_HPP