mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user