From 40bd9186da6c3a46add40d861062138c44677805 Mon Sep 17 00:00:00 2001 From: Eric Mertens Date: Tue, 28 Jan 2025 19:04:36 -0800 Subject: [PATCH] add ref.hpp --- ref.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 ref.hpp diff --git a/ref.hpp b/ref.hpp new file mode 100644 index 0000000..4d12863 --- /dev/null +++ b/ref.hpp @@ -0,0 +1,18 @@ +#pragma once + +#include +#include + +#include + +template +struct FnDeleter { + auto operator()(T *ptr) const -> void { Free(ptr); } +}; + +template +using Ref = std::unique_ptr>; + +using EVP_PKEY_CTX_Ref = Ref; +using X509_Ref = Ref; +using EVP_PKEY_Ref = Ref;