diff --git a/rpcs3/Emu/Memory/vm_ptr.h b/rpcs3/Emu/Memory/vm_ptr.h index 40060e0336..38a40e3b2d 100644 --- a/rpcs3/Emu/Memory/vm_ptr.h +++ b/rpcs3/Emu/Memory/vm_ptr.h @@ -82,20 +82,21 @@ namespace vm } // Get vm reference to a struct member - template requires PtrComparable + template requires PtrComparable && (!std::is_void_v) _ref_base ref(MT T2::*const mptr) const { return vm::cast(vm::cast(m_addr) + offset32(mptr)); } // Get vm reference to a struct member with array subscription - template > requires PtrComparable + template > requires PtrComparable && (!std::is_void_v) _ref_base ref(MT T2::*const mptr, u32 index) const { return vm::cast(vm::cast(m_addr) + offset32(mptr) + u32{sizeof(ET)} * index); } // Get vm reference + template requires (!std::is_void_v) _ref_base ref() const { return vm::cast(m_addr); @@ -106,6 +107,7 @@ namespace vm return static_cast(vm::base(vm::cast(m_addr))); } + template requires (!std::is_void_v) T* operator ->() const { return get_ptr();