<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[woaibcheng的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/woaibcheng</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; woaibcheng]]></copyright><item><title><![CDATA[C++ STL multimap 完全指南]]></title><link>https://blog.youkuaiyun.com/woaibcheng/article/details/161002083</link><guid>https://blog.youkuaiyun.com/woaibcheng/article/details/161002083</guid><author>woaibcheng</author><pubDate>Tue, 12 May 2026 08:43:12 +0800</pubDate><description><![CDATA[摘要：std::multimap是C++ STL中的关联容器，允许存储多个相同键的键值对并自动排序。与std::map不同，它没有operator[]和at()方法，插入操作总是成功。主要特性包括：支持多种构造函数、迭代器遍历、容量查询、插入删除操作（insert/erase）、查找功能（find/count/equal_range）等。特别适合处理一对多的键值关系，如学生成绩管理场景。C++17新增了extract和merge方法用于高效节点操作。使用时应注意equal_range()比多次find()更]]></description><category></category></item><item><title><![CDATA[C++ STL queue 完全指南]]></title><link>https://blog.youkuaiyun.com/woaibcheng/article/details/160699592</link><guid>https://blog.youkuaiyun.com/woaibcheng/article/details/160699592</guid><author>woaibcheng</author><pubDate>Sat, 02 May 2026 09:42:32 +0800</pubDate><description><![CDATA[本文详细介绍了C++标准库中的std::queue容器适配器。作为基于适配器模式实现的先进先出(FIFO)队列，std::queue通过封装底层容器（默认std::deque）提供入队(push)、出队(pop)、访问队头(front)和队尾(back)等基本操作。文章系统讲解了其数据结构设计、模板定义、构造/赋值方法、元素数量查询、队列操作函数以及非成员函数，并提供了丰富的示例代码。特别强调了std::queue不支持std::vector作为底层容器、无迭代器特性以及线程安全注意事项，指出其适用于BFS]]></description><category></category></item><item><title><![CDATA[C++ STL 适配器 stack 完全指南]]></title><link>https://blog.youkuaiyun.com/woaibcheng/article/details/160392959</link><guid>https://blog.youkuaiyun.com/woaibcheng/article/details/160392959</guid><author>woaibcheng</author><pubDate>Fri, 24 Apr 2026 20:30:27 +0800</pubDate><description><![CDATA[本文全面介绍了C++ STL中的stack容器适配器。stack遵循后进先出(LIFO)原则，默认使用deque作为底层容器，也可指定vector或list。文章详细讲解了stack的数据结构特点、底层容器要求、典型应用场景（如函数调用栈、DFS等），并系统介绍了构造函数、成员函数（push/pop/top等）的使用方法。同时分析了各操作的时间复杂度（均为O(1)），强调了使用注意事项（如空栈操作风险）。stack通过封装底层容器实现了严格的LIFO语义，是处理后进先出需求的理想选择，能有效提升代码可读性和]]></description><category></category></item><item><title><![CDATA[C++ STL forward_list 完全指南]]></title><link>https://blog.youkuaiyun.com/woaibcheng/article/details/160200051</link><guid>https://blog.youkuaiyun.com/woaibcheng/article/details/160200051</guid><author>woaibcheng</author><pubDate>Fri, 17 Apr 2026 21:05:13 +0800</pubDate><description><![CDATA[C++ STL中的forward_list是C++11引入的单向链表容器，相比双向链表list具有更小的内存开销。它只支持前向迭代，提供insert_after、erase_after等特殊操作函数。forward_list适用于需要频繁中间插入/删除但不需要随机访问的场景，如哈希表冲突链实现。主要特点包括：每个节点仅含数据和next指针；插入删除时间复杂度O(1)；不支持反向遍历；内存占用比list更小。该容器特别适合对内存敏感且只需单向链接的数据结构实现。]]></description><category></category></item><item><title><![CDATA[C++ STL deque容器完全指南]]></title><link>https://blog.youkuaiyun.com/woaibcheng/article/details/160085631</link><guid>https://blog.youkuaiyun.com/woaibcheng/article/details/160085631</guid><author>woaibcheng</author><pubDate>Tue, 14 Apr 2026 11:12:05 +0800</pubDate><description><![CDATA[本文全面介绍了C++ STL中的deque容器，主要内容包括： 基本特性：双端队列结构，支持高效头尾操作，提供随机访问能力 构造函数：支持多种初始化方式，包括默认构造、拷贝构造、移动构造等 元素访问：通过[]、at()、front()、back()等方法访问元素 迭代器操作：包括正向、反向迭代器及其常量版本 容量管理：size()、max_size()、resize()等方法 增删操作：push/pop_front/back、insert/erase等方法 高效构造：emplace系列方法避免临时对象创建 ]]></description><category></category></item><item><title><![CDATA[C++ STL array 完全指南]]></title><link>https://blog.youkuaiyun.com/woaibcheng/article/details/160025411</link><guid>https://blog.youkuaiyun.com/woaibcheng/article/details/160025411</guid><author>woaibcheng</author><pubDate>Fri, 10 Apr 2026 20:35:10 +0800</pubDate><description><![CDATA[《C++ STL容器std::array完全指南》摘要 std::array是C++11引入的固定大小数组容器，封装原生数组的同时提供STL接口。关键特性包括：1）固定大小N在编译时确定；2）连续内存布局；3）零运行时开销。主要功能：元素访问（at/operator[]/front/back/data）、迭代器支持（正向/反向迭代器）、容量查询（size/max_size）以及填充交换操作（fill/swap）。相比原生数组，std::array自带大小信息、支持边界检查，且兼容STL算法。]]></description><category></category></item><item><title><![CDATA[C++ string 容器完全指南]]></title><link>https://blog.youkuaiyun.com/woaibcheng/article/details/159922703</link><guid>https://blog.youkuaiyun.com/woaibcheng/article/details/159922703</guid><author>woaibcheng</author><pubDate>Tue, 07 Apr 2026 21:39:15 +0800</pubDate><description><![CDATA[本文全面介绍了C++标准库中的string容器，从基础用法到高级特性。主要内容包括：1. string的多种构造方式及初始化方法；2. 字符串赋值、拼接、插入和替换操作；3. 元素访问和修改方法；4. 容量管理和大小调整；5. 字符串查找、比较和子串提取；6. 数值与字符串的相互转换；7. 输入输出操作；8. C++20新增功能如starts_with/ends_with等。通过大量示例代码展示了string容器的强大功能，帮助开发者高效处理字符串操作，替代传统的C风格字符串。]]></description><category></category></item><item><title><![CDATA[C++ 分配器（Allocator）详解]]></title><link>https://blog.youkuaiyun.com/woaibcheng/article/details/159887763</link><guid>https://blog.youkuaiyun.com/woaibcheng/article/details/159887763</guid><author>woaibcheng</author><pubDate>Mon, 06 Apr 2026 21:18:51 +0800</pubDate><description><![CDATA[本文详细介绍了C++分配器(Allocator)的原理与实现。分配器是STL容器内存管理的核心组件，负责内存分配和对象构造解耦。文章首先解析了标准分配器std::allocator的接口和使用方法，包括allocate/deallocate等核心操作。然后重点讲解了自定义分配器的实现规范，通过实例演示了如何开发具有内存追踪功能的分配器，并分析了其在vector扩容过程中的内存行为。最后讨论了内存池优化、C++17新特性及最佳实践，为特定场景下的内存管理优化提供了解决方案。掌握分配器技术能帮助开发者深入理解S]]></description><category></category></item><item><title><![CDATA[C++ STL map 完全指南]]></title><link>https://blog.youkuaiyun.com/woaibcheng/article/details/159845585</link><guid>https://blog.youkuaiyun.com/woaibcheng/article/details/159845585</guid><author>woaibcheng</author><pubDate>Sun, 05 Apr 2026 19:43:44 +0800</pubDate><description><![CDATA[本文详细介绍了C++标准库中的std::map容器。std::map是基于红黑树实现的关联容器，存储键值对并按键自动排序。文章从核心特性、模板参数、构造函数开始讲解，重点阐述了迭代器的使用（包括正向/反向迭代器）、元素访问方法(at/[])，以及常用成员函数如empty/size/max_size等。随后详细说明了插入操作(insert/emplace/try_emplace)、查找操作(find/count/contains)、删除操作(erase/clear)等核心功能，并介绍了合并(merge)等等]]></description><category></category></item><item><title><![CDATA[C++ STL list 容器完全指南]]></title><link>https://blog.youkuaiyun.com/woaibcheng/article/details/159816340</link><guid>https://blog.youkuaiyun.com/woaibcheng/article/details/159816340</guid><author>woaibcheng</author><pubDate>Sat, 04 Apr 2026 20:18:56 +0800</pubDate><description><![CDATA[list是C++标准模板库(STL)中的双向链表容器，位于list头文件中。它适合频繁在任意位置插入/删除元素的场景，具有以下特点： 增删效率高(O(1)时间复杂度) 不支持随机访问(只能通过迭代器移动) 空间利用率低(每个节点存储两个指针) 提供双向迭代器(支持++和--操作) ]]></description><category></category></item><item><title><![CDATA[C++ STL vector完全指南]]></title><link>https://blog.youkuaiyun.com/woaibcheng/article/details/159752512</link><guid>https://blog.youkuaiyun.com/woaibcheng/article/details/159752512</guid><author>woaibcheng</author><pubDate>Fri, 03 Apr 2026 20:44:18 +0800</pubDate><description><![CDATA[本文全面解析C++ STL中的vector容器，包括基础特性、构造函数、迭代器、常用接口、内存管理和迭代器失效问题。vector作为动态数组，具有自动扩容、连续内存存储等优势，适合随机访问但头部/中间操作效率较低。文章详细介绍了各种构造函数、迭代器类型及操作方法，以及assign、insert、push_back等常用接口的使用场景和性能优化技巧。特别强调了内存管理策略和迭代器失效问题，建议预分配容量和使用emplace_back优化性能。最后总结vector适用场景和使用注意事项，为C++开发者提供实用参]]></description><category></category></item></channel></rss>