我已经定义了boost :: bimap-
typedef boost::bimap
<
boost::bimaps::unordered_set_of <CrString>,
boost::bimaps::unordered_set_of <RU64>
> xBimap
每次我检查我是否已经拥有bimap中的值 -
// Take iterator to the left node
xBimap::left_iterator left_iter = m_bimap.left.find(CrString(pi_pLeft));
// Check if found
if(left_iter != m_bimap.left.end()) // Found
如果不是我使用命令 -
插入它m_bimap.insert(xBimap::value_type(pi_pLeft, pi_nRight));
我有时在散列中找不到字符串,尽管它确实存在,而在其他情况下我已经找到了完全相同的字符串。然后,当我尝试再次将值插入bimap时,我看到bi-map中的值的数量不会改变。
你知道我在散列中找不到字符串的原因是什么?
感谢。