#include #include #include #include #include struct Test; typedef std::shared_ptr TestPtr; struct Test{ Test(int a, std::string b):a(a),b(b){} int a; std::string b; }; int main() { std::map> cont; TestPtr t1 = std::make_shared(1,"a"); TestPtr t2 = std::make_shared(2,"b"); TestPtr t3 = std::make_shared(3,"c"); TestPtr t4 = std::make_shared(4,"d"); cont = { { 1, t1 }, { 2, t2 }, { 3, t3 }, { 4, t4 } }; std::map>::iterator it; it = find_if(cont.begin(),cont.end(),[](std::pair it){ return it.first == 2;}); if (it != cont.end()) { std::cout<first<<","<second<
上一篇 波士顿房价数据分析预测----Kaggle项目笔记
下一篇 【C++】-- STL容器适配器之底层deque浅析
版权所有 (c)2021-2022 MSHXW.COM
ICP备案号:晋ICP备2021003244-6号