Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- inline void**& getvtable( void* inst, size_t offset = 0 )
- {
- return *reinterpret_cast<void***>( (size_t)inst + offset );
- }
- inline const void** getvtable( const void* inst, size_t offset = 0 )
- {
- return *reinterpret_cast<const void***>( (size_t)inst + offset );
- }
- template< typename Fn >
- inline Fn getvfunc( const void* inst, size_t index, size_t offset = 0 )
- {
- return reinterpret_cast<Fn>( getvtable( inst, offset )[ index ] );
- }
- //===================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement