首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

标准关联容器一定比vector的查找速度快吗?

,拒绝编译 //将循环中 * 改成 ** 可能输出你想要的结果,也可能不是,因为它是按照指针的值进行排序,而不是 string的值排序 //为什么会出现以上问题?...*,const std::string*,bool>{ bool operator()(const std::string *ps1, const std::string *ps2) const...//为什么必须创造一个仿函数类而不是简单地为set写一个比较函数,你可能想这样试试 见 5 //5 bool stringPtrLessSS(const std::string* ps1, const...<*it<<std::endl; //*it = "lyyy";//错误,不能编译 //2 //为什么 set或者 multiset里得元素不是常数开始 假设一个雇员得类 见 2 //2 class...//也不是,记住 operator[]立即为 添加或更新的意思 //1,当添加时候 ,insert高效 //2,当一个等价的键,更新时,[]高效 //这是为什么呢?

1.8K10
领券