]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/system/include/boost/system/detail/local_free_on_destruction.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / system / include / boost / system / detail / local_free_on_destruction.hpp
CommitLineData
7c673cae
FG
1// local_free_on_exit.hpp ------------------------------------------------------------//
2
3// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
4// Copyright (c) 2010 Beman Dawes
5
6// Distributed under the Boost Software License, Version 1.0.
7// See http://www.boost.org/LICENSE_1_0.txt
8
9// This is derived from boost/asio/detail/local_free_on_block_exit.hpp to avoid
10// a dependency on asio. Thanks to Chris Kohlhoff for pointing it out.
11
12#ifndef BOOST_SYSTEM_LOCAL_FREE_ON_EXIT_HPP
13#define BOOST_SYSTEM_LOCAL_FREE_ON_EXIT_HPP
14
15namespace boost {
16namespace system {
17namespace detail {
18
19class local_free_on_destruction
20{
21public:
22 explicit local_free_on_destruction(void* p)
23 : p_(p) {}
24
25 ~local_free_on_destruction()
26 {
27 ::LocalFree(p_);
28 }
29
30private:
31 void* p_;
32 local_free_on_destruction(const local_free_on_destruction&); // = deleted
33 local_free_on_destruction& operator=(const local_free_on_destruction&); // = deleted
34};
35
36} // namespace detail
37} // namespace system
38} // namespace boost
39
40#endif // BOOST_SYSTEM_LOCAL_FREE_ON_EXIT_HPP