summaryrefslogtreecommitdiff
path: root/service/uptr.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-01-09 13:58:38 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-01-09 13:58:38 +0000
commit62d506c24aaf543f84c82e2850a05b1387e4990d (patch)
tree3d356dcef6cb64baf648119c6b61aa9afd4e450b /service/uptr.h
parentExclude api.h from tidy checks (diff)
downloadmirrorsearch-62d506c24aaf543f84c82e2850a05b1387e4990d.tar.bz2
mirrorsearch-62d506c24aaf543f84c82e2850a05b1387e4990d.tar.xz
mirrorsearch-62d506c24aaf543f84c82e2850a05b1387e4990d.zip
Clang format
Diffstat (limited to 'service/uptr.h')
-rw-r--r--service/uptr.h21
1 files changed, 9 insertions, 12 deletions
diff --git a/service/uptr.h b/service/uptr.h
index 17eb28d..e73e098 100644
--- a/service/uptr.h
+++ b/service/uptr.h
@@ -1,24 +1,22 @@
#ifndef MIRRORSEARCH_UPTR_H
#define MIRRORSEARCH_UPTR_H
-#include <memory>
#include <functional>
+#include <memory>
#include <stdexcept>
namespace MirrorSearch {
typedef std::function<void(const std::string &)> OnError;
- std::string
- failingFunction(void * const func);
+ std::string failingFunction(void * const func);
- void
- defaultErrorHandler(const std::string &);
+ void defaultErrorHandler(const std::string &);
- template<typename O> using UPtr = std::unique_ptr<O, void(*)(O*)>;
+ template<typename O> using UPtr = std::unique_ptr<O, void (*)(O *)>;
- template<typename R, typename ... P, typename ... A>
+ template<typename R, typename... P, typename... A>
R *
- make_unique(R * (*func)(P...), OnError onError, A ... p)
+ make_unique(R * (*func)(P...), OnError onError, A... p)
{
if (auto obj = func(p...)) {
return obj;
@@ -27,13 +25,12 @@ namespace MirrorSearch {
throw std::runtime_error("Error handler did not throw");
}
- template<typename R, typename ... P, typename ... A>
+ template<typename R, typename... P, typename... A>
UPtr<R>
- make_unique(R*(*get)(P...), void(*release)(R*), OnError onError, A ... p)
+ make_unique(R * (*get)(P...), void (*release)(R *), OnError onError, A... p)
{
- return std::unique_ptr<R, void(*)(R*)>(make_unique(get, onError, p...), release);
+ return std::unique_ptr<R, void (*)(R *)>(make_unique(get, onError, p...), release);
}
}
#endif
-