What I am trying to do, is to create custom string comparator:
struct MyComparator {
bool operator()(const std::string& lhs, const std::string& rhs) const
{
return some_odd_strings_comparison_here;
}
};
And to use it with unordered map:
std::unordered_map<std::string, T, std::hash<std::string>, MyComparator> some_odd_map
= {{...}, {...}, ...};
The final goal is to search through the map:
auto el = some_odd_map.find(smthng);
if (el != some_odd_map.end()) {
// Found!
}
The problem is that my comparator is never actually get triggered.
UPDATE: Minimal reproducible example