From 2cf9d90c221e6ecf97cac3c6a56bd4e072f0474b Mon Sep 17 00:00:00 2001 From: vng Date: Fri, 7 Sep 2012 18:18:11 +0300 Subject: [PATCH] Fix formatting due to our coding style. --- base/scope_guard.hpp | 94 ++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/base/scope_guard.hpp b/base/scope_guard.hpp index 65f9b40d9d..038b31ccdf 100644 --- a/base/scope_guard.hpp +++ b/base/scope_guard.hpp @@ -7,56 +7,56 @@ namespace my { - namespace impl +namespace impl +{ + /// Base class for all ScopeGuards. + class GuardBase + { + public: + /// Disable ScopeGuard functionality on it's destruction + void release() const { - /// Base class for all ScopeGuards. - class GuardBase - { - public: - /// Disable ScopeGuard functionality on it's destruction - void release() const - { - m_bDoRollback = false; - } - - protected: - - GuardBase() : m_bDoRollback(true) - { - } - - // Do something in the destructor - mutable bool m_bDoRollback; - }; - - /// ScopeGuard for specific functor - template class GuardImpl : public GuardBase - { - public: - explicit GuardImpl(TFunctor const & F) : m_Functor(F) - { - } - - ~GuardImpl() - { - if (m_bDoRollback) - m_Functor(); - } - - private: - TFunctor m_Functor; - }; - } // namespace impl - - typedef impl::GuardBase const & scope_guard; - - /// Create scope_guard - template - impl::GuardImpl make_scope_guard(TFunctor const & F) - { - return impl::GuardImpl(F); + m_bDoRollback = false; } + protected: + + GuardBase() : m_bDoRollback(true) + { + } + + // Do something in the destructor + mutable bool m_bDoRollback; + }; + + /// ScopeGuard for specific functor + template class GuardImpl : public GuardBase + { + public: + explicit GuardImpl(TFunctor const & F) : m_Functor(F) + { + } + + ~GuardImpl() + { + if (m_bDoRollback) + m_Functor(); + } + + private: + TFunctor m_Functor; + }; +} // namespace impl + +typedef impl::GuardBase const & scope_guard; + +/// Create scope_guard +template +impl::GuardImpl make_scope_guard(TFunctor const & F) +{ + return impl::GuardImpl(F); +} + } // namespace my #define MY_SCOPE_GUARD(name, func) \