mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-03-07 13:06:29 +00:00
arm_types: Specialize std::hash for LocationDescriptor (#14)
Same thing, but with the benefit of working with anything that uses std::hash by default.
This commit is contained in:
@@ -137,12 +137,6 @@ private:
|
||||
Arm::FPSCR fpscr; ///< Floating point status control register.
|
||||
};
|
||||
|
||||
struct LocationDescriptorHash {
|
||||
size_t operator()(const LocationDescriptor& x) const {
|
||||
return std::hash<u64>()(x.UniqueHash());
|
||||
}
|
||||
};
|
||||
|
||||
const char* CondToString(Cond cond, bool explicit_al = false);
|
||||
const char* RegToString(Reg reg);
|
||||
const char* ExtRegToString(ExtReg reg);
|
||||
@@ -183,3 +177,12 @@ inline ExtReg operator+(ExtReg reg, size_t number) {
|
||||
|
||||
} // namespace Arm
|
||||
} // namespace Dynarmic
|
||||
|
||||
namespace std {
|
||||
template <>
|
||||
struct hash<Dynarmic::Arm::LocationDescriptor> {
|
||||
size_t operator()(const Dynarmic::Arm::LocationDescriptor& x) const {
|
||||
return std::hash<u64>()(x.UniqueHash());
|
||||
}
|
||||
};
|
||||
} // namespace std
|
||||
|
||||
Reference in New Issue
Block a user