[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$f356k8zp6l8xbc":3,"portal-md-ab09a7b4385c1030fed34039ac5d7fa4":326},{"code":4,"data":5},2000,{"sectionUuid":6,"section":7,"prev":324,"next":325},"6bf5ba24464f7fc956222c43845a52ac",{"uuid":6,"name":8,"category":9,"menu":10},"C++ STL开发技能","优雅编码",[11,66,90,134,163,187,215,235,255,288,308],{"id":12,"isCategory":13,"label":14,"children":15,"access":61},15,true,"C++ STL 开发技能",[16,20,24,28,33,37,41,45,49,53,57,62],{"id":17,"path":6,"label":18,"access":19},2,"C++ STL Cookbook教程内容介绍","free",{"id":21,"path":22,"label":23,"access":19},3,"c2fbb59ef56bceab84d783b0ac63a76f","C++20新特性",{"id":25,"path":26,"label":27,"access":19},4,"a9b195ed3063eb61089bfdae8a314bc6","C++ STL通用特性",{"id":29,"path":30,"label":31,"access":32},5,"2ff329938a463854b30c89ad9469853d","C++ STL容器","login",{"id":34,"path":35,"label":36,"access":32},6,"ab09a7b4385c1030fed34039ac5d7fa4","C++ STL迭代器",{"id":38,"path":39,"label":40,"access":32},7,"2520d8a6f936db4c970b300fd31caa3d","C++ STL Lambda表达式",{"id":42,"path":43,"label":44,"access":32},8,"08f5363b656b4ef3f9fea28d0b4cb4e8","C++ STL算法",{"id":46,"path":47,"label":48,"access":32},9,"2c33791aa4bea1b2be4eba597d0f9052","C++ STL字符串与流",{"id":50,"path":51,"label":52,"access":32},10,"4e4e1d371393aa3eef4d98048dcce9f5","C++ STL工具类与智能指针",{"id":54,"path":55,"label":56,"access":32},11,"5cff049c04b0875b6db4c7efe764acb9","C++ STL并发与并行",{"id":58,"path":59,"label":60,"access":61},12,"f2c47205fdb61a1ed2810662f8c67822","C++ STL文件系统","vip",{"id":63,"path":64,"label":65,"access":61},13,"90a010dc36e4c91c4c7cb5331160a09f","C++ STL综合实战",{"id":67,"isCategory":13,"label":68,"children":69,"access":61},23,"第1章：C++20\u002F23核心特性速览",[70,74,78,82,86],{"id":71,"path":72,"label":73,"access":61},17,"67d2ba19b872a78cb2aebc9317f4ba8c","1.1. 概念（Concepts）：如何使用requires子句约束模板，让STL算法报错信息更友好",{"id":75,"path":76,"label":77,"access":61},18,"0c415cc878910f80b2c967ddb0f35445","1.2. 范围（Ranges）库初探：引入std::ranges::sort、std::views::filter，告别传统迭代器对（Iterator Pairs）",{"id":79,"path":80,"label":81,"access":61},19,"14956f85de9dbdec8f4e32830d4c77e3","1.3. 协程（Coroutines）基础：理解协程在惰性生成器中的应用（虽不直接属于STL，但影响异步流处理）",{"id":83,"path":84,"label":85,"access":61},20,"76b73a97ec1eeff2ac17f0746127de3c","1.4. 格式化库（Formatting）：用std::format替代cout和sprintf进行类型安全的字符串格式化",{"id":87,"path":88,"label":89,"access":61},21,"cb9532daba26a1e57cac91e9ca9eca3e","1.5. 三向比较（Spaceship Operator \u003C=>）：如何为自定义类型自动生成比较运算符，以便在std::map和std::sort中使用",{"id":91,"isCategory":13,"label":92,"children":93,"access":61},36,"第2章：容器——选择比努力更重要",[94,98,102,106,110,114,118,122,126,130],{"id":95,"path":96,"label":97,"access":61},25,"cff63622815e8a627de5b6e2dde5c561","1. 顺序容器（Sequence Containers），std::vector的优化——使用reserve预分配内存，避免频繁重分配",{"id":99,"path":100,"label":101,"access":61},26,"b10d76db424857f2b7de39c65af81d02","2. 顺序容器（Sequence Containers），std::deque vs std::vector——在双端插入\u002F删除时的性能抉择",{"id":103,"path":104,"label":105,"access":61},27,"b025dcd6b1361d800d1128a96bad164c","3. 顺序容器（Sequence Containers），std::list的尴尬——为什么在现代硬件上链表通常不是首选（缓存局部性分析）",{"id":107,"path":108,"label":109,"access":61},28,"74192c50d9578399f320f8ccab0966a5","4. 关联容器（Associative Containers），std::map的插入策略——operator[",{"id":111,"path":112,"label":113,"access":61},29,"8887de2a0135664534f3a8c00ab7a8c6","5. 关联容器（Associative Containers），自定义类型作为std::set的键——必须提供严格的弱排序（Strict Weak Ordering）",{"id":115,"path":116,"label":117,"access":61},30,"03a934d93fd6c6a8303db541a59e1d4b","6. 关联容器（Associative Containers），std::map的提取与节点句柄（Node Handle, C++17）——如何在不重新分配内存的情况下修改键或合并两个map",{"id":119,"path":120,"label":121,"access":61},31,"bad945e50e7f0502329793f5f8a862be","7. 无序关联容器（Unordered Containers），为自定义类型设计哈希函数——特化std::hash",{"id":123,"path":124,"label":125,"access":61},32,"b6a61621fd6953ce25d9871ea4ca0e0e","8. 无序关联容器（Unordered Containers），负载因子（Load Factor）与重哈希（Rehashing）——调整桶数优化性能",{"id":127,"path":128,"label":129,"access":61},33,"f7c6aaa9d29847705774a91406c0e3ca","9. 容器适配器（Container Adapters），用std::priority_queue实现任务调度器——理解底层容器与比较器",{"id":131,"path":132,"label":133,"access":61},34,"6797cb10f3a074b1c0d846689ba24fc9","10. 容器适配器（Container Adapters），std::stack与std::queue——在RPN计算器中的实际应用",{"id":135,"isCategory":13,"label":136,"children":137,"access":61},45,"第3章：迭代器与范围——遍历的艺术",[138,147,151,155,159],{"id":139,"path":140,"label":141,"children":142,"access":61},38,"d0e6427ca678b62a96ae81750a67dc86","11. 迭代器类别：输入、输出、前向、双向、随机访问的区别",[143],{"id":144,"path":145,"label":146,"access":61},39,"bd4fcba091c865eda1387f12aea2d0b8","11.1. 编写自己的迭代器——使自定义容器能与STL算法无缝对接",{"id":148,"path":149,"label":150,"access":61},40,"718f967cb0c6c23bf23915091dcfc3a2","12. 插入迭代器（Insert Iterators）：std::back_inserter、std::front_inserter、std::inserter的使用场景",{"id":152,"path":153,"label":154,"access":61},41,"98c0eae2f4e9579c0a50ea249052247b","13. 流迭代器（Stream Iterators）：利用std::istream_iterator从文件直接填充容器",{"id":156,"path":157,"label":158,"access":61},42,"4bd619fbe2ff280603086ab23cb53827","14. 视图（Views）与组合（Composition）——使用std::views::transform | std::views::filter实现惰性计算",{"id":160,"path":161,"label":162,"access":61},43,"1dd53f79f11756444aa5e2a1edcb112b","15. 哨兵（Sentinel）与无限范围——定义自己的范围结束标记",{"id":164,"isCategory":13,"label":165,"children":166,"access":61},53,"第4章：Lambda表达式与函数对象",[167,171,175,179,183],{"id":168,"path":169,"label":170,"access":61},47,"bac6205e7a7bb5ce3e94877633e53974","16. Lambda的本质——编译器如何展开Lambda表达式",{"id":172,"path":173,"label":174,"access":61},48,"e4f750626014adeedb896154acfa4284","17. 广义捕获（Init Capture, C++14）与移动捕获（C++14\u002F17）——将unique_ptr传入Lambda",{"id":176,"path":177,"label":178,"access":61},49,"74ff6673b4d83404fc257e072bd813ef","18. 泛型Lambda（C++14）与模板Lambda（C++20）",{"id":180,"path":181,"label":182,"access":61},50,"a0c6d9e8e11925137005135948aaf1ad","19. 将Lambda存储为std::function vs auto——性能与类型擦除的开销分析",{"id":184,"path":185,"label":186,"access":61},51,"cecfe1ce8268f4d5b672e4c5997eefad","20. 组合高阶函数——实现类似Python的filter和map链式调用",{"id":188,"isCategory":13,"label":189,"children":190,"access":61},62,"第5章：算法基础与惯用法",[191,195,199,203,207,211],{"id":192,"path":193,"label":194,"access":61},55,"469e6aa8f06c1b294886f9fc67fd4f38","21. 循环vs算法，为什么要用算法代替手写循环——减少出错，意图清晰",{"id":196,"path":197,"label":198,"access":61},56,"e695bd1bfcdd3eaf49fdd074ac2028dc","22. 非修改式算法，std::find_if与std::any_of——检查容器中是否存在满足条件的元素",{"id":200,"path":201,"label":202,"access":61},57,"da7183b9700e58aba3c4c66e3fd418ab","23. 修改式算法，消除（Erase-Remove）惯用法：真正从容器中删除元素的正确姿势",{"id":204,"path":205,"label":206,"access":61},58,"723c79b0406fb075544f24c724cadbbf","24. 修改式算法，std::transform——对范围执行映射操作",{"id":208,"path":209,"label":210,"access":61},59,"dd1578f11c4ac3c3aa5905340e424744","25. 排序与查找，std::sort、std::partial_sort与std::nth_element——何时该用哪个？",{"id":212,"path":213,"label":214,"access":61},60,"7ce28693e9c9cd74d78fea297a4dcfb4","26. 排序与查找，在排序vector中查找：std::lower_bound\u002Fupper_bound vs std::binary_search vs std::equal_range",{"id":216,"isCategory":13,"label":217,"children":218,"access":61},69,"第6章：高级算法与数值处理",[219,223,227,231],{"id":220,"path":221,"label":222,"access":61},64,"597ad1ac5c615243bd44f1a867b7baeb","27. 利用std::accumulate（或std::reduce）实现复杂的折叠操作",{"id":224,"path":225,"label":226,"access":61},65,"a924344e5b79533597faa579d6cf0e06","28. 滑动窗口统计——使用std::adjacent_difference与std::partial_sum",{"id":228,"path":229,"label":230,"access":61},66,"d702eb831443a9717aaf19a49f558a28","29. 实现transform_if——虽然标准库没有，但我们可以用STL工具组合出来",{"id":232,"path":233,"label":234,"access":61},67,"644d83f7feb0948b296aa3341c57cf5f","30. 采样与排列——std::sample（C++17）与std::next_permutation",{"id":236,"isCategory":13,"label":237,"children":238,"access":61},76,"第7章：字符串、正则与I\u002FO",[239,243,247,251],{"id":240,"path":241,"label":242,"access":61},71,"ecfbb2db4c4ee272dba19e925b85aa05","31. 高性能字符串拼接——std::string的operator+ vs ostringstream vs std::format",{"id":244,"path":245,"label":246,"access":61},72,"c677d4cd8893199b1e025d981181d8b2","32. 字符串视图（std::string_view）——作为函数参数的最佳实践，避免临时拷贝",{"id":248,"path":249,"label":250,"access":61},73,"d3564926165b97a6b2b44a4274043433","33. 正则表达式实战——使用std::regex解析日志文件或验证输入",{"id":252,"path":253,"label":254,"access":61},74,"1bb0e734d17eebf2243591e7edb209e3","34. 文件系统（Filesystem, C++17）：遍历目录、创建文件、处理路径",{"id":256,"isCategory":13,"label":257,"children":258,"access":61},86,"第8章：实用工具与智能指针",[259,263,267,271,275],{"id":260,"path":261,"label":262,"access":61},78,"f2cb736823c024426215fa8fe62ffb20","35. 时间处理（std::chrono）：测量代码执行时间、处理时区（C++20）",{"id":264,"path":265,"label":266,"access":61},79,"a13a50306216c812d803555553758d7e","36. std::optional：表示可能存在或不存在的值，替代魔术数字或指针",{"id":268,"path":269,"label":270,"access":61},80,"8470595bc108fa2b834c77ac9e46559e","37. std::variant与std::visit：类型安全的联合体，处理多种数据类型",{"id":272,"path":273,"label":274,"access":61},81,"704139ec0cfe1389f42f1d9af491090d","38. std::any：存储任意类型的单个值",{"id":276,"path":277,"label":278,"children":279,"access":61},82,"d27f8a34a9660e4475203df47d2fc250","39. 智能指针详解",[280,284],{"id":281,"path":282,"label":283,"access":61},83,"6c6f64ccf33feac296c44e9575ee9e38","39.1. std::unique_ptr：独占所有权，自定义删除器（Deleter）",{"id":285,"path":286,"label":287,"access":61},84,"504879709618f96cf3f4f91de34311dd","39.2. std::shared_ptr与std::weak_ptr：循环引用破解",{"id":289,"isCategory":13,"label":290,"children":291,"access":61},93,"第9章：并发与并行STL",[292,296,300,304],{"id":293,"path":294,"label":295,"access":61},88,"b831ca665023f692b0e439623ae8983f","40. 并行算法（C++17）：给std::sort或std::transform加上执行策略（std::execution::par）",{"id":297,"path":298,"label":299,"access":61},89,"9d3475bd3ffab7b0a6fd14d1730418c0","41. 线程与锁：使用std::thread与std::mutex保护共享数据",{"id":301,"path":302,"label":303,"access":61},90,"f1898fe179cb51f77020a537048d2920","42. 原子操作（std::atomic）：无锁编程基础",{"id":305,"path":306,"label":307,"access":61},91,"d4da103c512e64858e3a9daeb95d54dc","43. future与promise：从异步任务中获取返回值",{"id":309,"label":310,"children":311,"access":61},98,"第10章：文件系统与数据处理",[312,316,320],{"id":313,"path":314,"label":315,"access":61},95,"b564170786f73d96253f097d7ce1189b","44. 大文件分块读写：结合内存映射文件（虽然标准库没有，但可结合系统API与STL容器）",{"id":317,"path":318,"label":319,"access":61},96,"c03c5d69348b8c08cadd0858a011086b","45. CSV解析器：结合std::ifstream、std::getline和std::views::split（C++20）实现",{"id":321,"path":322,"label":323,"access":61},97,"66a38d00e27891419f746cbca554261d","46. 数值库（std::valarray与复数std::complex）：用于科学计算的快速向量运算",{"path":30,"label":31,"access":32},{"path":39,"label":40,"access":32},{"code":4,"msg":327,"data":328},"success",{"last_modify_datetime":329,"sys_article_tags":330,"custom_article_tags":331,"special_column":332,"title":329,"id":329,"markdown":329,"number_of_visits":334,"status":335},"",[],[],{"name":333,"article_nums":334,"subscribe_nums":334},"公众号：CTO Plus",0,"not_login"]