From fcbf91b7cba730efff5ef305fc77ea6ac698dcc0 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 25 Aug 2019 17:28:54 +0300 Subject: [PATCH] Deprecate fxm::get_always And also its unused fxm::import_always counterpart --- rpcs3/Emu/IdManager.h | 51 ------------------------------------------- 1 file changed, 51 deletions(-) diff --git a/rpcs3/Emu/IdManager.h b/rpcs3/Emu/IdManager.h index 982078e1ce..b99357aa45 100644 --- a/rpcs3/Emu/IdManager.h +++ b/rpcs3/Emu/IdManager.h @@ -679,57 +679,6 @@ public: return ptr; } - // Emplace the object return by provider() (old object will be removed if it exists) - template - static auto import_always(F&& provider, Args&&... args) -> decltype(static_cast>(provider(std::forward(args)...))) - { - std::shared_ptr ptr; - std::shared_ptr old; - { - std::lock_guard lock(id_manager::g_mutex); - - auto& cur = g_vec[get_type()]; - - ptr = provider(std::forward(args)...); - - if (ptr) - { - old = std::move(cur); - cur = ptr; - } - else - { - return nullptr; - } - } - - return ptr; - } - - // Get the object unconditionally (create an object if it doesn't exist) - template - static std::enable_if_t::value, std::shared_ptr> get_always(Args&&... args) - { - std::shared_ptr ptr; - { - std::lock_guard lock(id_manager::g_mutex); - - auto& old = g_vec[get_type()]; - - if (old) - { - return {old, static_cast(old.get())}; - } - else - { - ptr = std::make_shared(std::forward(args)...); - old = ptr; - } - } - - return ptr; - } - // Unsafe version of check(), can be used in some cases template static inline T* check_unlocked()