Add std::less specialisation

For std::shared_ptr<const Plugin>, so that the order of elements
returned by GameCache.GetPlugins() is dependent on filenames only.
This commit is contained in:
Oliver Hamlet
2017-02-06 18:02:31 +00:00
parent 2efa47f03f
commit 5addce2922
+10
View File
@@ -77,4 +77,14 @@ private:
};
}
namespace std {
template<>
struct less<std::shared_ptr<const loot::Plugin>> {
size_t operator() (const std::shared_ptr<const loot::Plugin>& lhs,
const std::shared_ptr<const loot::Plugin>& rhs) const {
return lhs->GetLowercasedName() < rhs->GetLowercasedName();
}
};
}
#endif