]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/winapi/detail/cast_ptr.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / winapi / detail / cast_ptr.hpp
CommitLineData
b32b8144
FG
1/*
2 * Copyright 2015 Andrey Semashev
3 *
4 * Distributed under the Boost Software License, Version 1.0.
5 * See http://www.boost.org/LICENSE_1_0.txt
6 */
7c673cae 7
b32b8144
FG
8#ifndef BOOST_WINAPI_DETAIL_CAST_PTR_HPP_INCLUDED_
9#define BOOST_WINAPI_DETAIL_CAST_PTR_HPP_INCLUDED_
7c673cae 10
b32b8144 11#include <boost/winapi/config.hpp>
20effc67 12#include <boost/winapi/detail/header.hpp>
7c673cae
FG
13
14#ifdef BOOST_HAS_PRAGMA_ONCE
15#pragma once
16#endif
17
18namespace boost {
7c673cae
FG
19namespace winapi {
20namespace detail {
21
22//! This class is used to automatically cast pointers to the type used in the current Windows SDK function declarations
23class cast_ptr
24{
25private:
26 const void* m_p;
27
28public:
29 explicit BOOST_FORCEINLINE cast_ptr(const void* p) BOOST_NOEXCEPT : m_p(p) {}
30 template< typename T >
31 BOOST_FORCEINLINE operator T* () const BOOST_NOEXCEPT { return (T*)m_p; }
32};
33
34}
35}
36}
7c673cae 37
20effc67
TL
38#include <boost/winapi/detail/footer.hpp>
39
b32b8144 40#endif // BOOST_WINAPI_DETAIL_CAST_PTR_HPP_INCLUDED_