diff --git a/Utilities/typemap.h b/Utilities/typemap.h index a725138c27..4a2edeb296 100644 --- a/Utilities/typemap.h +++ b/Utilities/typemap.h @@ -506,7 +506,7 @@ namespace utils template typemap_head* get_head() const { - return &m_map[stx::type_counter::type>.index()]; + return &m_map[stx::typeindex>()]; } public: diff --git a/rpcs3/util/fixed_typemap.hpp b/rpcs3/util/fixed_typemap.hpp index 81739fbf1f..01c8526111 100644 --- a/rpcs3/util/fixed_typemap.hpp +++ b/rpcs3/util/fixed_typemap.hpp @@ -96,7 +96,7 @@ namespace stx template As* init(Args&&... args) noexcept { - auto& ptr = m_list[stx::type_counter::template type>.index()]; + auto& ptr = m_list[stx::typeindex>()]; if (ptr) { @@ -112,7 +112,7 @@ namespace stx template T* get() const noexcept { - return static_cast(m_list[stx::type_counter::template type>.index()]); + return static_cast(m_list[stx::typeindex>()]); } }; } diff --git a/rpcs3/util/typeindices.hpp b/rpcs3/util/typeindices.hpp index f8ae73dec2..1e2443d306 100644 --- a/rpcs3/util/typeindices.hpp +++ b/rpcs3/util/typeindices.hpp @@ -123,4 +123,11 @@ namespace stx typelist_v.next->next = this; typelist_v.next = this; } + + // Type index accessor + template + inline unsigned typeindex() noexcept + { + return type_counter::template type.index(); + } }