From 2c80de4bf9ba4a7ee852540168c3de9bc9ec17d9 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 3 Dec 2016 07:11:16 +0100 Subject: fixup! tracker/{aruco,pt}: use RAII for QObject --- compat/util.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'compat') diff --git a/compat/util.hpp b/compat/util.hpp index a63e245f..5b9e2c69 100644 --- a/compat/util.hpp +++ b/compat/util.hpp @@ -1,10 +1,15 @@ #pragma once +#include "ndebug-guard.hpp" + #include "make-unique.hpp" #include "run-in-thread.hpp" #include #include +#include + +#include #define progn(...) ([&]() { __VA_ARGS__ }()) template using mem = std::shared_ptr; @@ -41,3 +46,11 @@ inline auto clamp(const t& val, const u& min, const w& max) -> decltype(val * mi { return ::util_detail::clamp_(val, min, max); } + +template +auto qptr(xs... args) +{ + return QSharedPointer(new t(std::forward(args)...)); +} + +template using qshared = QSharedPointer; -- cgit v1.2.3