Skip to content

Commit

Permalink
Refactor AutoDispose and AutoRelease
Browse files Browse the repository at this point in the history
Removed redundant class definitions and replaced them with type aliases.
  • Loading branch information
Artyom Ivanov authored and asfernandes committed Dec 10, 2024
1 parent a8c5b9f commit 0058185
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions src/common/classes/auto.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,25 +191,11 @@ class AutoPtr
void operator=(AutoPtr&);
};

template <typename T>
using AutoDispose = AutoPtr<T, SimpleDispose>;

template <typename Where>
class AutoDispose : public AutoPtr<Where, SimpleDispose>
{
public:
AutoDispose(Where* v = nullptr)
: AutoPtr<Where, SimpleDispose>(v)
{ }
};


template <typename Where>
class AutoRelease : public AutoPtr<Where, SimpleRelease>
{
public:
AutoRelease(Where* v = nullptr)
: AutoPtr<Where, SimpleRelease>(v)
{ }
};
template <typename T>
using AutoRelease = AutoPtr<T, SimpleRelease>;


template <typename T>
Expand Down

0 comments on commit 0058185

Please sign in to comment.