Given a vector
of unordered_map
,
I would like to check if the vector
contains any duplicated values. Two unordered_maps a
you can something similar to the following :
typedef unordered_map int_map;
struct my_map_comparator
{
bool operator()(const int_map& a, const int_map& b)
{
a_hash = compute_hash_for_a(all keys of a)
b_hash = compute_hash_for_b(all keys of b)
return a_hash == b_hash;
}
};
std::unordered_set, my_map_comparator> map_list();