diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-05-22 01:09:47 +0200 |
---|---|---|
committer | Tobias Nießen <tniessen@tnie.de> | 2018-05-25 15:57:19 +0200 |
commit | 7d77068c786d81fa43b6b6d80ac97e1bd53be4c8 (patch) | |
tree | 56ab742b18c28b164c7437a0c17fb413d9a8994a /src/node_crypto.h | |
parent | 65dbc52a9beacb23a45ed5d7b1fa4bce792e8142 (diff) | |
download | android-node-v8-7d77068c786d81fa43b6b6d80ac97e1bd53be4c8.tar.gz android-node-v8-7d77068c786d81fa43b6b6d80ac97e1bd53be4c8.tar.bz2 android-node-v8-7d77068c786d81fa43b6b6d80ac97e1bd53be4c8.zip |
src: move DeleteFnPtr into util.h
This is more generally useful than just in a crypto context.
PR-URL: https://github.com/nodejs/node/pull/20885
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'src/node_crypto.h')
-rw-r--r-- | src/node_crypto.h | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/node_crypto.h b/src/node_crypto.h index ee933ede1f..06b76b42ff 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -75,15 +75,6 @@ struct MarkPopErrorOnReturn { ~MarkPopErrorOnReturn() { ERR_pop_to_mark(); } }; -template <typename T, void (*function)(T*)> -struct FunctionDeleter { - void operator()(T* pointer) const { function(pointer); } - typedef std::unique_ptr<T, FunctionDeleter> Pointer; -}; - -template <typename T, void (*function)(T*)> -using DeleteFnPtr = typename FunctionDeleter<T, function>::Pointer; - // Define smart pointers for the most commonly used OpenSSL types: using X509Pointer = DeleteFnPtr<X509, X509_free>; using BIOPointer = DeleteFnPtr<BIO, BIO_free_all>; |