从boost无序映射中移除特定密钥
remove specific keys from boost unordered_map
我有一个boost无序映射容器(mymap(,我想删除一些键,预测器会为它们返回true。
boost::range::remove_if(mymap, ((boost::bind(&mesh::type, (boost::bind(&map_type::value_type::first, _1)))) == EDGE) );
网格::类型定义如下:
class mesh
{
...
Type type() const;
...
}
"EDGE"是"类型枚举"之一。
这是我得到的错误:
error: non-static const member ‘const mesh std::pair<const mesh, std::vector<std::vector<Point> > >::first’, can’t use default assignment operator
我使用的是增强版本1.53和C++03。
// define this, either as a static member function or in a
// private namespace...
bool is_edge(const map_type::value_type& vt)
{
// note: concerned with the key, not the data
return vt.first.type() == EDGE;
}
// ... and avoid all the unreadable bind nastiness completely
boost::range::remove_if(mymap, is_edge);
相关文章:
- SSH通过/sbin/SSH无法读取RSA密钥文件(从控制台运行)
- 允许从 std::map 的密钥窃取资源?
- TMap::Emplace() 在应用现有密钥时会覆盖吗?
- 在没有密钥的情况下读取密文的剩余噪声预算
- 如何修复无效的API密钥,IP或操作权限错误?
- 所有可能的链接生成器与64位密钥
- 如何在unordered_map中更改密钥?
- 获取当前密钥状态?
- curl_easy_perform() 失败:SSL 对等证书或 SSH 远程密钥不正常
- 将密钥发送到非前台的游戏窗口
- 有哪些方法可以对基于 256 位密钥的矩阵进行加扰?
- BOOST Property_Tree:每个密钥的多个值
- 如何在使用 Boost.bimap 时避免密钥复制
- Boost property_map测试密钥是否存在?
- 如何在Boost multi_index复合密钥中擦除
- 如何使用boost::multi_index复合密钥
- 如何为成员的成员创建boost multi_index密钥
- std::set和boost::shared_ptr唯一密钥标识问题
- 从boost无序映射中移除特定密钥
- 如何使用websockettp::connection_hdl作为密钥来实现boost::unorderede_map