From a841177c5b60af7c513047cf3e8eef9c4108251b Mon Sep 17 00:00:00 2001 From: luzhen <33650326+deepin-mozart@users.noreply.github.com> Date: Thu, 23 Dec 2021 15:21:55 +0800 Subject: [PATCH] Fix valid function invoke failed in future class (#75) In C++11, shared_ptr has an explicit operator bool which means that a shared_ptr can't be implicitly converted to a bool. adding an explicit cast is a valid fix to the code. --- include/dap/future.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/dap/future.h b/include/dap/future.h index 4b2d5f2..af103c3 100644 --- a/include/dap/future.h +++ b/include/dap/future.h @@ -93,7 +93,7 @@ future::future(const std::shared_ptr& s) : state(s) {} template bool future::valid() const { - return state; + return static_cast(state); } template