Skip to content

Commit d406ef7

Browse files
committed
Update CVirtualTable:GetMethod methods
1 parent f850c0b commit d406ef7

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

include/dynlibutils/virtual.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ class CVirtualTable : public CMemoryView<void *>
126126
template<class T> CVirtualTable(T *pClass) : CBase(*reinterpret_cast<void **>(pClass)) {}
127127

128128
public: // Getters.
129-
template<typename R> R &GetMethod(std::ptrdiff_t nIndex) { return CBase::Offset(nIndex).RCast<R &>(); }
130-
template<typename R> R GetMethod(std::ptrdiff_t nIndex) const { return CBase::Offset(nIndex).RCast<R>(); }
129+
template<typename R> R GetMethod(std::ptrdiff_t nIndex) const { return reinterpret_cast<R>(CBase::Offset(nIndex).GetPtr()); }
131130

132131
public: // Callers.
133132
template<typename R, typename... Args> R CallMethod(std::ptrdiff_t nIndex, Args... args) { return GetMethod<R (*)(void *, Args...)>(nIndex)(this, args...); }

0 commit comments

Comments
 (0)