1 // local_free_on_exit.hpp ------------------------------------------------------------//
3 // Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
4 // Copyright (c) 2010 Beman Dawes
6 // Distributed under the Boost Software License, Version 1.0.
7 // See http://www.boost.org/LICENSE_1_0.txt
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.
12 #ifndef BOOST_SYSTEM_LOCAL_FREE_ON_EXIT_HPP
13 #define BOOST_SYSTEM_LOCAL_FREE_ON_EXIT_HPP
15 #include <boost/winapi/local_memory.hpp>
21 class local_free_on_destruction
24 explicit local_free_on_destruction(void* p)
27 ~local_free_on_destruction()
29 boost::winapi::LocalFree(p_);
34 local_free_on_destruction(const local_free_on_destruction&); // = deleted
35 local_free_on_destruction& operator=(const local_free_on_destruction&); // = deleted
42 #endif // BOOST_SYSTEM_LOCAL_FREE_ON_EXIT_HPP