From a5c040684a3094fbc05efa6f1207f32a974f843b Mon Sep 17 00:00:00 2001 From: falsycat Date: Mon, 24 Jul 2023 21:39:49 +0900 Subject: [PATCH] replace static_assert bad complex idiom with simpler one --- iface/common/task.hh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/iface/common/task.hh b/iface/common/task.hh index e856c24..6e8e826 100644 --- a/iface/common/task.hh +++ b/iface/common/task.hh @@ -117,9 +117,7 @@ class TaskQueue : public std::enable_shared_from_this> { } else if constexpr (std::is_invocable_v) { f(std::forward(args1)...); } else { - []() { - static_assert(kValidFunction, "a function to wrap is invalid"); - }(); + static_assert(false, "the wrapped function is invalid"); } }, loc, -- 2.47.2