summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/node_crypto.h9
-rw-r--r--src/util.h9
2 files changed, 9 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>;
diff --git a/src/util.h b/src/util.h
index 0e6fd5dd06..26654f15a1 100644
--- a/src/util.h
+++ b/src/util.h
@@ -456,6 +456,15 @@ struct is_callable<T, typename std::enable_if<
std::is_same<decltype(void(&T::operator())), void>::value
>::type> : std::true_type { };
+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;
+
} // namespace node
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS