Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:53:44

0001 /*
0002  * Copyright 2015 Andrey Semashev
0003  *
0004  * Distributed under the Boost Software License, Version 1.0.
0005  * See http://www.boost.org/LICENSE_1_0.txt
0006  */
0007 
0008 #ifndef BOOST_WINAPI_DETAIL_CAST_PTR_HPP_INCLUDED_
0009 #define BOOST_WINAPI_DETAIL_CAST_PTR_HPP_INCLUDED_
0010 
0011 #include <boost/winapi/config.hpp>
0012 #include <boost/winapi/detail/header.hpp>
0013 
0014 #ifdef BOOST_HAS_PRAGMA_ONCE
0015 #pragma once
0016 #endif
0017 
0018 namespace boost {
0019 namespace winapi {
0020 namespace detail {
0021 
0022 //! This class is used to automatically cast pointers to the type used in the current Windows SDK function declarations
0023 class cast_ptr
0024 {
0025 private:
0026     const void* m_p;
0027 
0028 public:
0029     explicit BOOST_FORCEINLINE cast_ptr(const void* p) BOOST_NOEXCEPT : m_p(p) {}
0030     template< typename T >
0031     BOOST_FORCEINLINE operator T* () const BOOST_NOEXCEPT { return (T*)m_p; }
0032 };
0033 
0034 }
0035 }
0036 }
0037 
0038 #include <boost/winapi/detail/footer.hpp>
0039 
0040 #endif // BOOST_WINAPI_DETAIL_CAST_PTR_HPP_INCLUDED_