UniqueCPtr: add doc comment

Explain what a UniqueCPtr is.
This commit is contained in:
Matthias Schiffer 2022-02-09 21:26:12 +01:00
parent 3160b59cdd
commit fbef307c90
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C

View file

@ -10,7 +10,9 @@
#include <cstdlib>
#include <memory>
// UniqueCPtr is a wrapper around std::unique_ptr using std::free as its deallocator
//
// This allows to use it to manage memory allocated by C APIs (malloc, realloc, ...)
template<typename T> class UniqueCPtr : public std::unique_ptr<T, void (*)(void *)> {
public:
UniqueCPtr() : std::unique_ptr<T, void (*)(void *)>(nullptr, std::free) {}