workaround GCC < 7.0 bug

template specialization from namespace must be enclosed in the namespace
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
This commit is contained in:
Andrey Filipenkov
2022-09-24 15:55:25 +03:00
parent 44174da9a2
commit a5f9efb3df
+4 -1
View File
@@ -142,7 +142,9 @@ public:
VCMI_LIB_NAMESPACE_END
template <> struct std::hash<VCMI_LIB_WRAP_NAMESPACE(ResourceID)>
namespace std
{
template <> struct hash<VCMI_LIB_WRAP_NAMESPACE(ResourceID)>
{
size_t operator()(const VCMI_LIB_WRAP_NAMESPACE(ResourceID) & resourceIdent) const
{
@@ -151,3 +153,4 @@ template <> struct std::hash<VCMI_LIB_WRAP_NAMESPACE(ResourceID)>
return stringHasher(resourceIdent.getName()) ^ intHasher(static_cast<int>(resourceIdent.getType()));
}
};
}