diff options
author | vng <viktor.govako@gmail.com> | 2012-09-07 19:18:11 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:43:11 +0300 |
commit | 2cf9d90c221e6ecf97cac3c6a56bd4e072f0474b (patch) | |
tree | 8a503154058b665ccde04c820bf659be39da2cca /base | |
parent | a83a3c97ddaf5cac08d4c999f067b670f4303cdd (diff) |
Fix formatting due to our coding style.
Diffstat (limited to 'base')
-rw-r--r-- | base/scope_guard.hpp | 80 |
1 files changed, 40 insertions, 40 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,55 +7,55 @@ 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; - } + m_bDoRollback = false; + } - protected: + protected: - GuardBase() : m_bDoRollback(true) - { - } + GuardBase() : m_bDoRollback(true) + { + } - // Do something in the destructor - mutable bool m_bDoRollback; - }; + // Do something in the destructor + mutable bool m_bDoRollback; + }; - /// ScopeGuard for specific functor - template <typename TFunctor> class GuardImpl : public GuardBase - { - public: - explicit GuardImpl(TFunctor const & F) : m_Functor(F) - { - } + /// ScopeGuard for specific functor + template <typename TFunctor> class GuardImpl : public GuardBase + { + public: + explicit GuardImpl(TFunctor const & F) : m_Functor(F) + { + } - ~GuardImpl() - { - if (m_bDoRollback) - m_Functor(); - } + ~GuardImpl() + { + if (m_bDoRollback) + m_Functor(); + } - private: - TFunctor m_Functor; - }; - } // namespace impl + private: + TFunctor m_Functor; + }; +} // namespace impl - typedef impl::GuardBase const & scope_guard; +typedef impl::GuardBase const & scope_guard; - /// Create scope_guard - template <typename TFunctor> - impl::GuardImpl<TFunctor> make_scope_guard(TFunctor const & F) - { - return impl::GuardImpl<TFunctor>(F); - } +/// Create scope_guard +template <typename TFunctor> +impl::GuardImpl<TFunctor> make_scope_guard(TFunctor const & F) +{ + return impl::GuardImpl<TFunctor>(F); +} } // namespace my |