From 63e3ed4edccfc3bcc3c8ceb12b857432eb4ee9a3 Mon Sep 17 00:00:00 2001 From: Robert Konklewski Date: Mon, 5 Sep 2022 09:45:58 +0200 Subject: [PATCH] Fix incorrect initialization of unsafe_locker List initialization of unsafe_locker class resulted in a compiler error, because 1) it had no constructor matching the arguments, and 2) it had user-declared constructors, so aggregate initialization was not allowed. This change fixes the issue by adding an appropriate constructor. --- include/continuable/detail/transforms/wait.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/continuable/detail/transforms/wait.hpp b/include/continuable/detail/transforms/wait.hpp index c605f10..a2b4448 100644 --- a/include/continuable/detail/transforms/wait.hpp +++ b/include/continuable/detail/transforms/wait.hpp @@ -74,6 +74,13 @@ using condition_variable_t = std::condition_variable; template struct unsafe_unlocker { + explicit unsafe_unlocker(std::atomic_bool* ready, condition_variable_t* cv, + std::mutex* mutex, Result* result) + : ready_(ready) + , cv_(cv) + , mutex_(mutex) + , result_(result) {} + unsafe_unlocker(unsafe_unlocker const&) = delete; unsafe_unlocker(unsafe_unlocker&&) = default; unsafe_unlocker& operator=(unsafe_unlocker const&) = delete;