Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:39:20

0001 /*
0002  *          Copyright Andrey Semashev 2007 - 2015.
0003  * Distributed under the Boost Software License, Version 1.0.
0004  *    (See accompanying file LICENSE_1_0.txt or copy at
0005  *          http://www.boost.org/LICENSE_1_0.txt)
0006  */
0007 /*!
0008  * \file   cleanup_scope_guard.hpp
0009  * \author Andrey Semashev
0010  * \date   11.03.2008
0011  *
0012  * \brief  This header is the Boost.Log library implementation, see the library documentation
0013  *         at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html.
0014  */
0015 
0016 #ifndef BOOST_LOG_DETAIL_CLEANUP_SCOPE_GUARD_HPP_INCLUDED_
0017 #define BOOST_LOG_DETAIL_CLEANUP_SCOPE_GUARD_HPP_INCLUDED_
0018 
0019 #include <boost/log/detail/config.hpp>
0020 #include <boost/log/detail/header.hpp>
0021 
0022 #ifdef BOOST_HAS_PRAGMA_ONCE
0023 #pragma once
0024 #endif
0025 
0026 namespace boost {
0027 
0028 BOOST_LOG_OPEN_NAMESPACE
0029 
0030 namespace aux {
0031 
0032 //! Cleanup scope guard
0033 template< typename T >
0034 struct cleanup_guard
0035 {
0036     explicit cleanup_guard(T& obj) : m_Obj(obj) {}
0037     ~cleanup_guard() { m_Obj.clear(); }
0038 
0039     // Copying prohibited
0040     BOOST_DELETED_FUNCTION(cleanup_guard(cleanup_guard const&))
0041     BOOST_DELETED_FUNCTION(cleanup_guard& operator= (cleanup_guard const&))
0042 
0043 private:
0044     T& m_Obj;
0045 };
0046 
0047 } // namespace aux
0048 
0049 BOOST_LOG_CLOSE_NAMESPACE // namespace log
0050 
0051 } // namespace boost
0052 
0053 #include <boost/log/detail/footer.hpp>
0054 
0055 #endif // BOOST_LOG_DETAIL_CLEANUP_SCOPE_GUARD_HPP_INCLUDED_