c ++ boost插入失败

时间:2013-06-02 14:03:19

标签: c++ boost find insertion bimap

我已经定义了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中的值的数量不会改变。

你知道我在散列中找不到字符串的原因是什么?

感谢。

0 个答案:

没有答案