mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 15:00:17 +02:00
PassManager: Constrain GetPass() template to Pass-derived objects
Makes the particular conversion types constrained to catch any trivial misuses.
This commit is contained in:
1 parent
d619e36523
commit
ecb9b3b7f8
1 file changed
+2
-1
@@ -13,6 +13,7 @@ $end_info$
|
||||
#include <FEXCore/fextl/unordered_map.h>
|
||||
#include <FEXCore/fextl/vector.h>
|
||||
|
||||
#include <concepts>
|
||||
#include <utility>
|
||||
|
||||
namespace FEXCore::Context {
|
||||
@@ -50,7 +51,7 @@ public:
|
||||
return NameToPassMaping.contains(Name);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
template<std::derived_from<Pass> T>
|
||||
T* GetPass(const fextl::string& Name) {
|
||||
return dynamic_cast<T*>(GetPass(Name));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user