blocking_worker: Make use of templated lambda

We can simplify this a little by explicitly specifying the typename for
the lambda function.
This commit is contained in:
Lioncash 2020-09-07 00:47:43 -04:00
parent 9652973db2
commit 188a3cf74c

View File

@ -109,9 +109,8 @@ private:
while (keep_running) {
work_event.Wait();
const auto visit_fn = [service, &keep_running](auto&& w) {
using T = std::decay_t<decltype(w)>;
if constexpr (std::is_same_v<T, std::monostate>) {
const auto visit_fn = [service, &keep_running]<typename T>(T&& w) {
if constexpr (std::is_same_v<std::decay_t<T>, std::monostate>) {
keep_running = false;
} else {
w.Execute(service);