sclang: ServerShmInterface - avoid object duplication in deepCopy
[supercollider.git] / external_libraries / boost / libs / system / src / local_free_on_destruction.hpp
blob110024f3d57cafba867a262924fa9f8501accc0e
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 namespace boost {
16 namespace system {
17 namespace detail {
19 class local_free_on_destruction
21 public:
22 explicit local_free_on_destruction(void* p)
23 : p_(p) {}
25 ~local_free_on_destruction()
27 ::LocalFree(p_);
30 private:
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
36 } // namespace detail
37 } // namespace system
38 } // namespace boost
40 #endif // BOOST_SYSTEM_LOCAL_FREE_ON_EXIT_HPP