<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://www.33dai.wiki/index.php?action=history&amp;feed=atom&amp;title=STL%E5%AE%B9%E5%99%A8%E5%BA%93%E5%B8%B8%E7%94%A8%E5%86%85%E5%AE%B9</id>
	<title>STL容器库常用内容 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://www.33dai.wiki/index.php?action=history&amp;feed=atom&amp;title=STL%E5%AE%B9%E5%99%A8%E5%BA%93%E5%B8%B8%E7%94%A8%E5%86%85%E5%AE%B9"/>
	<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=STL%E5%AE%B9%E5%99%A8%E5%BA%93%E5%B8%B8%E7%94%A8%E5%86%85%E5%AE%B9&amp;action=history"/>
	<updated>2026-05-14T11:49:24Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=STL%E5%AE%B9%E5%99%A8%E5%BA%93%E5%B8%B8%E7%94%A8%E5%86%85%E5%AE%B9&amp;diff=51&amp;oldid=prev</id>
		<title>2026年2月8日 (日) 09:46 33DAI</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=STL%E5%AE%B9%E5%99%A8%E5%BA%93%E5%B8%B8%E7%94%A8%E5%86%85%E5%AE%B9&amp;diff=51&amp;oldid=prev"/>
		<updated>2026-02-08T09:46:34Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年2月8日 (日) 09:46的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;第1行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [https://cpp.33dai.wiki/reference/zh/cpp/container.html C++ &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;文档 容器库&lt;/del&gt;]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [https://cpp.33dai.wiki/reference/zh/cpp/container.html C++&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;文档：容器库&lt;/ins&gt;]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[STL例子]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[STL例子]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key my_wiki:diff:1.41:old-41:rev-51:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>33DAI</name></author>
	</entry>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=STL%E5%AE%B9%E5%99%A8%E5%BA%93%E5%B8%B8%E7%94%A8%E5%86%85%E5%AE%B9&amp;diff=41&amp;oldid=prev</id>
		<title>2026年2月8日 (日) 01:50 33DAI</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=STL%E5%AE%B9%E5%99%A8%E5%BA%93%E5%B8%B8%E7%94%A8%E5%86%85%E5%AE%B9&amp;diff=41&amp;oldid=prev"/>
		<updated>2026-02-08T01:50:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年2月8日 (日) 01:50的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;第1行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[https://cpp.33dai.wiki/reference/zh/cpp/container.html C++ 文档 容器库]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* &lt;/ins&gt;[https://cpp.33dai.wiki/reference/zh/cpp/container.html C++ 文档 容器库]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* [[STL例子]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== vector（向量、动态数组） ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== vector（向量、动态数组） ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key my_wiki:diff:1.41:old-31:rev-41:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>33DAI</name></author>
	</entry>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=STL%E5%AE%B9%E5%99%A8%E5%BA%93%E5%B8%B8%E7%94%A8%E5%86%85%E5%AE%B9&amp;diff=31&amp;oldid=prev</id>
		<title>2026年2月6日 (五) 02:16 33DAI</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=STL%E5%AE%B9%E5%99%A8%E5%BA%93%E5%B8%B8%E7%94%A8%E5%86%85%E5%AE%B9&amp;diff=31&amp;oldid=prev"/>
		<updated>2026-02-06T02:16:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年2月6日 (五) 02:16的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;第1行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;= STL 容器库常用内容 =&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[https://cpp.33dai.wiki/reference/zh/cpp/container.html C++ 文档 容器库]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[https://cpp.33dai.wiki/reference/zh/cpp/container.html C++ 文档 容器库]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key my_wiki:diff:1.41:old-29:rev-31:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>33DAI</name></author>
	</entry>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=STL%E5%AE%B9%E5%99%A8%E5%BA%93%E5%B8%B8%E7%94%A8%E5%86%85%E5%AE%B9&amp;diff=29&amp;oldid=prev</id>
		<title>2026年2月5日 (四) 02:21 33DAI</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=STL%E5%AE%B9%E5%99%A8%E5%BA%93%E5%B8%B8%E7%94%A8%E5%86%85%E5%AE%B9&amp;diff=29&amp;oldid=prev"/>
		<updated>2026-02-05T02:21:34Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2026年2月5日 (四) 02:21的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l150&quot;&gt;第150行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第150行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* pq.size(); 返回当前优先队列中元素的数量。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* pq.size(); 返回当前优先队列中元素的数量。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* pq.empty(); 判断队列是否为空，为空返回真（ true ），否则返回假（ false ）。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* pq.empty(); 判断队列是否为空，为空返回真（ true ），否则返回假（ false ）。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:STL]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key my_wiki:diff:1.41:old-28:rev-29:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>33DAI</name></author>
	</entry>
	<entry>
		<id>https://www.33dai.wiki/index.php?title=STL%E5%AE%B9%E5%99%A8%E5%BA%93%E5%B8%B8%E7%94%A8%E5%86%85%E5%AE%B9&amp;diff=28&amp;oldid=prev</id>
		<title>33DAI：​创建页面，内容为“= STL 容器库常用内容 =  [https://cpp.33dai.wiki/reference/zh/cpp/container.html C++ 文档 容器库]  == vector（向量、动态数组） ==  * vector&lt;int&gt; a; 定义了一个名字叫作 a，可以存 int 的动态数组。初始数组为空。 * vector&lt;int&gt; a[100]; 定义了 100 个动态数组 a[0]~a[99] 都是动态数组。 * a.push_back(x); 添加元素，把 x 添加到动态数组末尾。 * a[pos] 访问元素，访问下标为 pos 的元素。…”</title>
		<link rel="alternate" type="text/html" href="https://www.33dai.wiki/index.php?title=STL%E5%AE%B9%E5%99%A8%E5%BA%93%E5%B8%B8%E7%94%A8%E5%86%85%E5%AE%B9&amp;diff=28&amp;oldid=prev"/>
		<updated>2026-02-05T02:20:46Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“= STL 容器库常用内容 =  [https://cpp.33dai.wiki/reference/zh/cpp/container.html C++ 文档 容器库]  == vector（向量、动态数组） ==  * vector&amp;lt;int&amp;gt; a; 定义了一个名字叫作 a，可以存 int 的动态数组。初始数组为空。 * vector&amp;lt;int&amp;gt; a[100]; 定义了 100 个动态数组 a[0]~a[99] 都是动态数组。 * a.push_back(x); 添加元素，把 x 添加到动态数组末尾。 * a[pos] 访问元素，访问下标为 pos 的元素。…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= STL 容器库常用内容 =&lt;br /&gt;
&lt;br /&gt;
[https://cpp.33dai.wiki/reference/zh/cpp/container.html C++ 文档 容器库]&lt;br /&gt;
&lt;br /&gt;
== vector（向量、动态数组） ==&lt;br /&gt;
&lt;br /&gt;
* vector&amp;lt;int&amp;gt; a; 定义了一个名字叫作 a，可以存 int 的动态数组。初始数组为空。&lt;br /&gt;
* vector&amp;lt;int&amp;gt; a[100]; 定义了 100 个动态数组 a[0]~a[99] 都是动态数组。&lt;br /&gt;
* a.push_back(x); 添加元素，把 x 添加到动态数组末尾。&lt;br /&gt;
* a[pos] 访问元素，访问下标为 pos 的元素。&lt;br /&gt;
* a.clear() 清空数组，清空整个数组，数组大小也归零了。&lt;br /&gt;
* a.resize(100) 更改数组大小，把数组大小修改为 100。&lt;br /&gt;
* a.size() 当前数组大小。&lt;br /&gt;
* a.empty() 数组是否为空，数组是空的就返回真。&lt;br /&gt;
* a.begin() 起始位置迭代器。&lt;br /&gt;
* a.end() 结束位置迭代器。&lt;br /&gt;
&lt;br /&gt;
== deque（双端队列） ==&lt;br /&gt;
&lt;br /&gt;
* deque&amp;lt;int&amp;gt; q; 定义了一个名字叫作 q 的双端队列。&lt;br /&gt;
* q.front() 返回队头（的引用）。&lt;br /&gt;
* q.back() 返回队尾（的引用）。&lt;br /&gt;
* q.push_back(x); 从队列末尾放入 x。&lt;br /&gt;
* q.push_front(x); 从队列开头放入 x。&lt;br /&gt;
* q.pop_back(); 从队列末尾弹出元素。&lt;br /&gt;
* q.pop_front(); 从队列开头弹出元素。&lt;br /&gt;
* q[pos] 访问元素，访问下标为 pos 的元素。&lt;br /&gt;
* q.clear() 清空双端队列，双端队列大小也归零了。&lt;br /&gt;
* q.size() 当前队列大小。&lt;br /&gt;
* q.empty() 队列是否为空，队列是空的就返回真。&lt;br /&gt;
&lt;br /&gt;
== stack（栈） ==&lt;br /&gt;
&lt;br /&gt;
* stack&amp;lt;int&amp;gt; sta; 定义了一个名字叫作 sta 的栈。&lt;br /&gt;
* sta.top() 返回栈顶（的引用）。&lt;br /&gt;
* sta.push(x); 把 x 压入栈。&lt;br /&gt;
* sta.pop(); 弹出栈顶元素。&lt;br /&gt;
* sta.size() 当前栈大小。&lt;br /&gt;
* sta.empty() 栈是否为空，栈是空的就返回真。&lt;br /&gt;
&lt;br /&gt;
== queue（队列） ==&lt;br /&gt;
&lt;br /&gt;
* queue&amp;lt;int&amp;gt; q; 定义了一个名字叫作 q 的队列。&lt;br /&gt;
* q.front() 返回队头（的引用）。&lt;br /&gt;
* q.back() 返回队尾（的引用）。&lt;br /&gt;
* q.push(x); 把 x 压入队列。&lt;br /&gt;
* q.pop(); 弹出队头。&lt;br /&gt;
* q.size() 当前队列大小。&lt;br /&gt;
* q.empty() 队列是否为空，队列是空的就返回真。&lt;br /&gt;
&lt;br /&gt;
== 结构体重载运算符 ==&lt;br /&gt;
* 重载运算的基本结构，一般参数会使用引用的形式来提高效率，叠加常量标记提高效率避免修改。&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot; line&amp;gt;&lt;br /&gt;
返回类型 类名::operator运算符(参数列表) {&lt;br /&gt;
    // 实现运算符逻辑&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* 操作样例（重载 &amp;lt; 运算符 用于排序）&lt;br /&gt;
** 定义结构体&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot; line&amp;gt;&lt;br /&gt;
struct Point {&lt;br /&gt;
    int x;  // x坐标&lt;br /&gt;
    int y;  // y坐标&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
** 重载 &amp;lt; 运算符&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot; line&amp;gt;&lt;br /&gt;
bool operator&amp;lt;(const Point&amp;amp; a, const Point&amp;amp; b) {&lt;br /&gt;
    if (a.x != b.x) return a.x &amp;lt; b.x;  // 先比x&lt;br /&gt;
    return a.y &amp;lt; b.y;                  // x相同再比y&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
** 排序示例（依赖 &amp;lt; 运算符）&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot; line&amp;gt;&lt;br /&gt;
vector&amp;lt;Point&amp;gt; points = {p3, p1, p2};&lt;br /&gt;
sort(points.begin(), points.end()); &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== map（映射）/unordered_map ==&lt;br /&gt;
&lt;br /&gt;
map 采用红黑树实现，unordered_map 则是采用哈希的形式。&lt;br /&gt;
&lt;br /&gt;
* map&amp;lt;int, string&amp;gt; m; 定义了一个名字叫作 m 的映射，键是 int 类型，值是 string 类型（默认按键升序排列）。&lt;br /&gt;
* map&amp;lt;string, int&amp;gt; mp[50]; 定义了 50 个映射 mp[0]~mp[49] ,每个都是键为 string，值为 int 的映射。&lt;br /&gt;
* m.insert(pair&amp;lt;int, string&amp;gt;(1, &amp;quot;apple&amp;quot;)); 插入键值对，将键为 1 、值为 &amp;quot;apple&amp;quot; 的键值对插入映射（键重复时插入失败）。&lt;br /&gt;
* m.insert({2, &amp;quot;banana&amp;quot;}); 插入键值对，用初始化列表形式插入键为 2、值为 &amp;quot;banana&amp;quot; 的键值对。&lt;br /&gt;
* m[3] = &amp;quot;orange&amp;quot;; 插入或修改值，若键 3 不存在则插入（键 3，值 &amp;quot;orange&amp;quot; ）；若存在则修改值为 &amp;quot;orange&amp;quot;。&lt;br /&gt;
* m.find(2); 查找键，返回指向键为 2 的键值对的迭代器，若不存在，返回 m.end() 。&lt;br /&gt;
* m.erase(1); 删除键值对，删除键为 1 的键值对。&lt;br /&gt;
* m.clear(); 清空映射，删除所有键值对，大小归零。&lt;br /&gt;
* m.size(); 当前映射中键值对的数量。&lt;br /&gt;
* m.empty(); 映射是否为空，为空返回真。&lt;br /&gt;
* m.begin(); 起始位置迭代器（指向第一个键值对）。&lt;br /&gt;
* m.end(); 结束位置迭代器（指向最后一个键值对的下一位）。&lt;br /&gt;
* 枚举 map&lt;br /&gt;
** 使用迭代器枚举&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot; line&amp;gt;&lt;br /&gt;
for(map&amp;lt;int, string&amp;gt;::iterator it = m.begin(); it != m.end(); it++)&lt;br /&gt;
    cout &amp;lt;&amp;lt; (*it).first &amp;lt;&amp;lt; &amp;quot; &amp;quot; &amp;lt;&amp;lt; (*it).second &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
** 自动推导类型&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot; line&amp;gt;&lt;br /&gt;
for(auto it = m.begin(); it != m.end(); it++)&lt;br /&gt;
    cout &amp;lt;&amp;lt; (*it).first &amp;lt;&amp;lt; &amp;quot; &amp;quot; &amp;lt;&amp;lt; (*it).second &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
** 使用基于范围的 for 循环&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot; line&amp;gt;&lt;br /&gt;
for(auto now : m)&lt;br /&gt;
    cout &amp;lt;&amp;lt; now.first &amp;lt;&amp;lt; &amp;quot; &amp;quot; &amp;lt;&amp;lt; now.second &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== set（集合）/unordered_set ==&lt;br /&gt;
&lt;br /&gt;
set 采用红黑树实现，unordered_set 则是采用哈希的形式。&lt;br /&gt;
&lt;br /&gt;
* set&amp;lt;int&amp;gt; s; 定义了一个名字叫作 s 的集合，存储 int 类型元素（默认升序排列，元素唯一）。&lt;br /&gt;
* set&amp;lt;string&amp;gt; ss[30]; 定义了 30 个集合 ss[0]~ss[29]，每个都是存储 string 类型元素的集合。&lt;br /&gt;
* s.insert(5); 插入元素，将 5 插入集合（若 5 已存在则插入失败）。&lt;br /&gt;
* s.find(5); 查找元素，返回指向元素 5 的迭代器；若不存在，返回 s.end()。&lt;br /&gt;
* s.erase(5); 删除元素，删除集合中的元素 5 。&lt;br /&gt;
* s.clear(); 清空集合，删除所有元素，大小归零。&lt;br /&gt;
* s.size(); 当前集合中元素的数量。&lt;br /&gt;
* s.empty(); 集合是否为空，为空返回真。&lt;br /&gt;
* s.begin(); 起始位置迭代器（指向第一个元素）。&lt;br /&gt;
* s.end(); 结束位置迭代器（指向最后一个元素的下一位）。&lt;br /&gt;
* 枚举 set&lt;br /&gt;
** 使用迭代器枚举&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot; line&amp;gt;&lt;br /&gt;
for(set&amp;lt;int&amp;gt;::iterator it = s.begin(); it != s.end(); it++)&lt;br /&gt;
    cout &amp;lt;&amp;lt; (*it) &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
** 自动推导类型&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot; line&amp;gt;&lt;br /&gt;
for(auto it = s.begin(); it != s.end(); it++)&lt;br /&gt;
    cout &amp;lt;&amp;lt; (*it) &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
** 使用基于范围的 for 循环&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cpp&amp;quot; line&amp;gt;&lt;br /&gt;
for(auto now : s)&lt;br /&gt;
    cout &amp;lt;&amp;lt; now &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== priority_queue（优先队列） ==&lt;br /&gt;
&lt;br /&gt;
* priority_queue&amp;lt;int&amp;gt; pq; 定义一个名为 pq 的优先队列，存储 int 类型元素，默认最大元素在队顶（大顶堆）。&lt;br /&gt;
* priority_queue&amp;lt;int, vector&amp;lt;int&amp;gt;, greater&amp;lt;int&amp;gt;&amp;gt; pq; 定义一个小顶堆的优先队列（最小的元素在队顶），需指定底层容器（通常为 vector ）和比较器 greater&amp;lt;int&amp;gt; 。&lt;br /&gt;
* pq.push(x); 插入元素，将 x 放入优先队列，插入后队列会自动重新排序。&lt;br /&gt;
* pq.top(); 返回队顶元素（的引用），即当前优先级最高的元素（大顶堆返回最大元素，小顶堆返回最小元素）。&lt;br /&gt;
* pq.pop(); 弹出队顶元素，删除当前优先级最高的元素（弹出后队列会重新排序）。&lt;br /&gt;
* pq.size(); 返回当前优先队列中元素的数量。&lt;br /&gt;
* pq.empty(); 判断队列是否为空，为空返回真（ true ），否则返回假（ false ）。&lt;/div&gt;</summary>
		<author><name>33DAI</name></author>
	</entry>
</feed>