diff --git a/Source/Core/Common/Functional.h b/Source/Core/Common/Functional.h index 7f96664041..bde566ae7c 100644 --- a/Source/Core/Common/Functional.h +++ b/Source/Core/Common/Functional.h @@ -45,7 +45,13 @@ private: struct Func : FuncBase { explicit Func(F&& f) : func{std::forward(f)} {} - result_type Invoke(Args... args) override { return func(std::forward(args)...); } + result_type Invoke(Args... args) override + { + if constexpr (std::is_void_v) + func(std::forward(args)...); + else + return func(std::forward(args)...); + } std::decay_t func; };