diff options
Diffstat (limited to 'src/dpl/core/include/cchecker/dpl/scoped_free.h')
-rw-r--r-- | src/dpl/core/include/cchecker/dpl/scoped_free.h | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/dpl/core/include/cchecker/dpl/scoped_free.h b/src/dpl/core/include/cchecker/dpl/scoped_free.h index d8fee50..72b0ae0 100644 --- a/src/dpl/core/include/cchecker/dpl/scoped_free.h +++ b/src/dpl/core/include/cchecker/dpl/scoped_free.h @@ -30,27 +30,25 @@ namespace CCHECKER { template<typename Class> -struct ScopedFreePolicy -{ - typedef Class* Type; - static Type NullValue() - { - return NULL; - } - static void Destroy(Type ptr) - { - free(ptr); - } +struct ScopedFreePolicy { + typedef Class *Type; + static Type NullValue() + { + return NULL; + } + static void Destroy(Type ptr) + { + free(ptr); + } }; template<typename Memory> -class ScopedFree : public ScopedResource<ScopedFreePolicy<Memory> > -{ - typedef ScopedFreePolicy<Memory> Policy; - typedef ScopedResource<Policy> BaseType; +class ScopedFree : public ScopedResource<ScopedFreePolicy<Memory>> { + typedef ScopedFreePolicy<Memory> Policy; + typedef ScopedResource<Policy> BaseType; - public: - explicit ScopedFree(Memory *ptr = Policy::NullValue()) : BaseType(ptr) { } +public: + explicit ScopedFree(Memory *ptr = Policy::NullValue()) : BaseType(ptr) { } }; } // namespace CCHECKER |