]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/winapi/include/boost/detail/winapi/detail/cast_ptr.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / winapi / include / boost / detail / winapi / detail / cast_ptr.hpp
CommitLineData
7c673cae
FG
1// cast_ptr.hpp --------------------------------------------------------------//
2
3// Copyright 2015 Andrey Semashev
4
5// Distributed under the Boost Software License, Version 1.0.
6// See http://www.boost.org/LICENSE_1_0.txt
7
8
9#ifndef BOOST_DETAIL_WINAPI_DETAIL_CAST_PTR_HPP
10#define BOOST_DETAIL_WINAPI_DETAIL_CAST_PTR_HPP
11
12#include <boost/detail/winapi/config.hpp>
13
14#ifdef BOOST_HAS_PRAGMA_ONCE
15#pragma once
16#endif
17
18namespace boost {
19namespace detail {
20namespace winapi {
21namespace detail {
22
23//! This class is used to automatically cast pointers to the type used in the current Windows SDK function declarations
24class cast_ptr
25{
26private:
27 const void* m_p;
28
29public:
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; }
33};
34
35}
36}
37}
38}
39
40#endif // BOOST_DETAIL_WINAPI_DETAIL_CAST_PTR_HPP