蓝桥ROS机器人之现代C++学习笔记4.2 无序容器code•2022-4-12•C•阅读47学习程序如下: #include #include #include #include int main() { // initialized in same order std::unordered_map u = { {1, "1"}, {3, "3"}, {2, "2"} }; std::map v = { {1, "1"}, {3, "3"}, {2, "2"} }; // iterates in the same way std::cout << "std::unordered_map" << std::endl; for( const auto & n : u) std::cout << "Key:[" << n.first << "] Value:[" << n.second << "]\n"; std::cout << std::endl; std::cout << "std::map" << std::endl; for( const auto & n : v) std::cout << "Key:[" << n.first << "] Value:[" << n.second << "]\n"; } 查资料☞无序:获取性能提升。 欢迎分享,转载请注明来源:内存溢出原文地址:https://54852.com/langs/584416.html赞 (0)打赏 微信扫一扫 支付宝扫一扫 code管理员组00 生成海报 C语言学习笔记Day9上一篇 2022-04-12games101 作业0 下一篇2022-04-12 发表评论 请登录后评论... 登录后才能评论 提交评论列表(0条)
评论列表(0条)