1 // cast_ptr.hpp --------------------------------------------------------------//
3 // Copyright 2015 Andrey Semashev
5 // Distributed under the Boost Software License, Version 1.0.
6 // See http://www.boost.org/LICENSE_1_0.txt
9 #ifndef BOOST_DETAIL_WINAPI_DETAIL_CAST_PTR_HPP
10 #define BOOST_DETAIL_WINAPI_DETAIL_CAST_PTR_HPP
12 #include <boost/detail/winapi/config.hpp>
14 #ifdef BOOST_HAS_PRAGMA_ONCE
23 //! This class is used to automatically cast pointers to the type used in the current Windows SDK function declarations
30 explicit BOOST_FORCEINLINE cast_ptr(const void* p) BOOST_NOEXCEPT : m_p(p) {}
31 template< typename T >
32 BOOST_FORCEINLINE operator T* () const BOOST_NOEXCEPT { return (T*)m_p; }
40 #endif // BOOST_DETAIL_WINAPI_DETAIL_CAST_PTR_HPP