From 6d617f40a4c7fe8dc16b46c2f9206a025349b8c6 Mon Sep 17 00:00:00 2001 From: Mat Sutcliffe Date: Sat, 17 Apr 2021 22:04:37 +0100 Subject: [PATCH] Use `*this` in lambda capture (C++17 feature) --- src/blackmisc/promise.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blackmisc/promise.h b/src/blackmisc/promise.h index 157fe91a9..b01821a51 100644 --- a/src/blackmisc/promise.h +++ b/src/blackmisc/promise.h @@ -93,7 +93,7 @@ namespace BlackMisc //! When the given future is ready, use its result to set the result of this promise. template - void chainResult(QFuture future) { doAfter(future, nullptr, [self = *this](auto &&f) mutable { self.setResult(f); }); } + void chainResult(QFuture future) { doAfter(future, nullptr, [*this](auto &&f) mutable { setResult(f); }); } //! Invoke a functor and use its return value to set the result. //! \details Useful for uniform syntax in generic code where T could be void.