Skip to content

Commit b3177c0

Browse files
committed
Fix Callback when return type is void
1 parent 66605f4 commit b3177c0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

util/callable.hh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ private:
5151
template<typename Callable>
5252
static Ret invoke(void *object, Args... args) {
5353
Callable &callable = *reinterpret_cast<Callable *>(object);
54-
return callable(std::forward<Args>(args)...);
54+
if constexpr (std::is_same_v<void, Ret>)
55+
callable(std::forward<Args>(args)...);
56+
else
57+
return callable(std::forward<Args>(args)...);
5558
}
5659

5760
template<typename Callable>

0 commit comments

Comments
 (0)