replace static_assert bad complex idiom with simpler one
This commit is contained in:
parent
f4e56dd83a
commit
a5c040684a
@ -117,9 +117,7 @@ class TaskQueue : public std::enable_shared_from_this<TaskQueue<Args...>> {
|
|||||||
} else if constexpr (std::is_invocable_v<F, decltype(args1)...>) {
|
} else if constexpr (std::is_invocable_v<F, decltype(args1)...>) {
|
||||||
f(std::forward<decltype(args1)>(args1)...);
|
f(std::forward<decltype(args1)>(args1)...);
|
||||||
} else {
|
} else {
|
||||||
[]<bool kValidFunction = false>() {
|
static_assert(false, "the wrapped function is invalid");
|
||||||
static_assert(kValidFunction, "a function to wrap is invalid");
|
|
||||||
}();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loc,
|
loc,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user