We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db13e8b commit 9f8620aCopy full SHA for 9f8620a
Generals/Code/GameEngine/Include/Common/STLTypedefs.h
@@ -204,10 +204,15 @@ namespace rts
204
205
template<> struct hash<AsciiString>
206
{
207
- size_t operator()(AsciiString ast) const
208
- {
209
- std::hash<const char *> tmp;
210
- return tmp((const char *) ast.str());
+ size_t operator()(const AsciiString& ast) const
+ {
+#ifdef USING_STLPORT
+ std::hash<const char*> tmp;
211
+ return tmp((const char*)ast.str());
212
+#else
213
+ std::hash<std::string_view> hasher;
214
+ return hasher(std::string_view(ast.str(), ast.getLength()));
215
+#endif
216
}
217
};
218
0 commit comments