Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get the keys of a std::hash_map object

Status
Not open for further replies.

globos

Programmer
Nov 8, 2000
260
FR
Hi,

I've taken a look at the STL documentation and found no means to get the defined keys of hash_map objects. How to get these keys?

Thanks.

--
Globos
 
I've found how to do, I forgot that iterators are pair<const Key, Data>. So just have to iterate on a hash_map object and put every key (it->first for iterator it) in a container.

--
Globos
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top