ALoopingIcon
ALoopingIcon

Reputation: 2348

Counting keys in a hash_multimap

What is the most efficient way to count all the different keys in a hash_multimap?

E.g. if I have a already filled hash_multimap, (e.g. a container where you can store multiple entities with a same key) how can i retrieve the set of keys?

Upvotes: 1

Views: 208

Answers (1)

Naveen
Naveen

Reputation: 73443

Insert the keys into a std::set and find the size of the set.

Upvotes: 1

Related Questions