Skip to content

Commit 1b952e2

Browse files
committed
Fix CVirtualTable::CallMethod method with costructor
1 parent d193dbc commit 1b952e2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/dynlibutils/virtual.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class CVirtualTable
157157
// R is the return type, Args... are the parameter types for the target function.
158158
// The function pointer is assumed to have the signature R (*)(void*, Args...),
159159
// where the first argument is the this-pointer.
160-
template<typename R, typename... Args> R CallMethod(std::ptrdiff_t nIndex, Args... args) { return GetMethod<R (*)(void *, Args...)>(nIndex)(this, args...); }
160+
template<typename R, typename... Args> R CallMethod(std::ptrdiff_t nIndex, Args... args) { return GetMethod<R (*)(Args...)>(nIndex)(args...); }
161161
template<typename R, typename... Args> R CallMethod(std::ptrdiff_t nIndex, Args... args) const { return const_cast<CThis *>(this)->CallMethod(nIndex, args...); }
162162

163163
// Union to store either:

0 commit comments

Comments
 (0)