检索STL映射键

HAS*_*ASM 3 c++ stl

有没有办法(除了存储密钥作为值的一部分并迭代地图)从STL地图检索密钥,multimap(hash_map)a lal key(%hash)?

Nik*_*nić 14

for (std::map<key, value>::iterator iter = m.begin(); iter != m.end(); ++iter)
    iter->first; // this is the key
Run Code Online (Sandbox Code Playgroud)