{"id":109,"date":"2024-03-11T22:57:32","date_gmt":"2024-03-11T14:57:32","guid":{"rendered":"https:\/\/ultserver.com\/blog\/?p=109"},"modified":"2024-12-27T09:23:55","modified_gmt":"2024-12-27T01:23:55","slug":"cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9","status":"publish","type":"post","link":"https:\/\/ultserver.com\/blog\/cpp\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\/","title":{"rendered":"C++\u5f00\u53d1\u65f6\u9047\u5230\u7684\u6613\u9519\u70b9"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">auto \u5173\u952e\u5b57<\/h2>\n\n\n\n<p>auto \u5728\u4f7f\u7528\u65f6\u975e\u5e38\u65b9\u4fbf\uff0c\u4f46\u662f\u7f16\u8bd1\u5668\u81ea\u52a8\u5224\u65ad\u7684\u7c7b\u578b\u53ef\u80fd\u9884\u671f\u4e0d\u7b26\uff0c\u4f8b\u5982 Eigen \u5728\u8fdb\u884c\u77e9\u9635\u8fd0\u7b97\u65f6\uff0c\u5c31\u5e94\u8be5\u5c3d\u53ef\u80fd\u907f\u514d\u4f7f\u7528 auto\uff0c\u5426\u5219\u4f1a\u4ea7\u751f\u96be\u4ee5\u9884\u671f\u7684\u7ed3\u679c\u3002\u8be6\u89c1<a href=\"https:\/\/ultserver.com\/blog\/cpp\/eigen%e4%b8%ad%e4%bd%bf%e7%94%a8auto%e5%8f%af%e8%83%bd%e5%af%bc%e8%87%b4%e7%9a%84%e8%ae%a1%e7%ae%97%e7%bb%93%e6%9e%9c%e9%94%99%e8%af%af%e9%97%ae%e9%a2%98\/\">\u672c\u535a\u6587<\/a>\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u51fd\u6570\u8fd4\u56de\u503c\u4e3a\u667a\u80fd\u6307\u9488<\/h2>\n\n\n\n<p>\u51fd\u6570\u8fd4\u56de\u503c\u4e3a\u667a\u80fd\u6307\u9488\u65f6\uff0c\u5982\u679c\u5bf9\u8fd4\u56de\u503c\u76f4\u63a5\u8fdb\u884c\u5bfb\u5740\u5e76\u5c06\u5bfb\u5740\u7ed3\u679c\u7528\u4e8e\u521d\u59cb\u5316\u5f15\u7528\uff0c\u5219\u4f1a\u5bfc\u81f4\u60ac\u7a7a\u5f15\u7528\u7684\u95ee\u9898\uff0c\u4f8b\u5982\uff1a<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7\">C++<\/span><span role=\"button\" tabindex=\"0\" data-code=\"std::shared_ptr&lt;Typre&gt; func();\nconst Type&amp; tmp = *func();\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #4EC9B0\">std<\/span><span style=\"color: #D4D4D4\">::<\/span><span style=\"color: #4EC9B0\">shared_ptr<\/span><span style=\"color: #D4D4D4\">&lt;<\/span><span style=\"color: #4EC9B0\">Typre<\/span><span style=\"color: #D4D4D4\">&gt; <\/span><span style=\"color: #DCDCAA\">func<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">const<\/span><span style=\"color: #D4D4D4\"> Type&amp; tmp = *<\/span><span style=\"color: #DCDCAA\">func<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u8fd9\u662f\u56e0\u4e3a\u5bf9\u8fd4\u56de\u503c\u5bfb\u5740\u540e\uff0c\u8fd4\u56de\u503c\u667a\u80fd\u6307\u9488\u7684\u5f15\u7528\u8ba1\u6570\u4e3a0\uff0c\u7a7a\u95f4\u88ab\u91ca\u653e\uff0c\u4ece\u800c\u5bfc\u81f4\u60ac\u7a7a\u5f15\u7528\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">size_t \u4f5c\u4e3a\u5faa\u73af\u53d8\u91cf<\/h2>\n\n\n\n<p>size_t \u901a\u5e38\u7528\u4f5c\u5b58\u50a8\u5bb9\u5668\u5c3a\u5bf8\u7684\u53d8\u91cf\uff0c\u4f46\u662f\u8be5\u7c7b\u578b\u4e3a\u65e0\u7b26\u53f7\u7c7b\u578b\uff0c\u56e0\u6b64\u5728\u4f7f\u7528 size_t \u4f5c\u4e3a\u5faa\u73af\u53d8\u91cf\u65f6\uff0c\u9700\u8981\u989d\u5916\u6ce8\u610f\u907f\u514d\u51fa\u73b0\u8d1f\u6570\u60c5\u51b5\uff0c\u5426\u5219 size_t \u4f1a\u53d1\u751f\u6ea2\u51fa\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">inline \u5173\u952e\u5b57\u7684\u8bef\u5bfc\u6027<\/h2>\n\n\n\n<p><code>inline<\/code> \u5173\u952e\u5b57\u5e38\u88ab\u7406\u89e3\u4e3a\u5c06\u51fd\u6570\u58f0\u660e\u4e3a\u5185\u8054\u51fd\u6570\u3002<\/p>\n\n\n\n<p>\u4f46\u5b9e\u9645\u4e0a\uff0c\u7f16\u8bd1\u5668\u5e76\u4e0d\u4f1a\u786e\u4fdd <code>inline<\/code> \u51fd\u6570\u4f1a\u88ab\u5185\u8054\u3002<\/p>\n\n\n\n<p><code>inline<\/code> \u7684\u5b9e\u9645\u4f5c\u7528\u4e3a\u5411\u94fe\u63a5\u5668\u58f0\u660e\u8be5\u51fd\u6570\u80fd\u591f\u88ab\u91cd\u590d\u5b9a\u4e49\uff0c\u56e0\u6b64\u4f7f\u5f97\u8be5\u51fd\u6570\u80fd\u591f\u88ab\u76f4\u63a5\u5b9a\u4e49\u5728\u5934\u6587\u4ef6\u4e2d\uff0c\u4ece\u800c\u63d0\u9ad8\u8be5\u51fd\u6570\u88ab\u5185\u8054\u7684\u53ef\u80fd\u6027\u3002<\/p>\n\n\n\n<p>\u76ee\u524d\u7f16\u8bd1\u5668\u4f1a\u81ea\u52a8\u5224\u65ad\u51fd\u6570\u662f\u5426\u9700\u8981\u5185\u8054\uff0c\u901a\u5e38\u4e0d\u518d\u9700\u8981\u624b\u52a8\u8bbe\u7f6e <code>inline<\/code>\uff08\u6a21\u7248\u81ea\u5e26inline\u6027\u8d28\uff0c\u65e0\u9700\u91cd\u590d\u58f0\u660e\uff09\u3002\u3010<a href=\"https:\/\/stackoverflow.com\/a\/1759575\/11889237\">\u53c2\u8003<\/a>\u3011<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7c7b\u6210\u5458\u7684\u521d\u59cb\u5316\u987a\u5e8f<\/h2>\n\n\n\n<p><a href=\"http:\/\/open-std.org\/JTC1\/SC22\/WG21\/docs\/papers\/2016\/n4594.pdf\">c++\u6807\u51c6<\/a>\u768412.6.2\u8282\u768413.3\u6307\u51fa\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Then, non-static data members are initialized in the order they were declared in the class definition (again regardless of the order of the mem-initializers).<\/p>\n<\/blockquote>\n\n\n\n<p>\u56e0\u6b64\uff0c\u5728\u975e\u59d4\u6d3e\u6784\u9020\u51fd\u6570\u4e2d\uff08delegating constructor\uff09\uff0c\u7c7b\u4e2d\u53d8\u91cf\u7684\u521d\u59cb\u5316\u987a\u5e8f\u4e3a\u58f0\u660e\u987a\u5e8f\uff0c\u800c\u4e0e\u521d\u59cb\u5316\u5217\u8868\u7684\u987a\u5e8f\u65e0\u5173\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6a21\u677f\u8d85\u51fa\u6700\u5927\u9012\u5f52\u9650\u5236<\/h2>\n\n\n\n<p>\u5982\u679c\u6a21\u677f\u4e2d\u5b9a\u4e49\u4e86\u9012\u5f52\u64cd\u4f5c\uff0c\u9700\u8981\u989d\u5916\u6ce8\u610f\u6a21\u677f\u9012\u5f52\u7684\u505c\u6b62\u6761\u4ef6\uff0c\u4f8b\u5982\u4e0b\u8ff0\u4ee3\u7801\uff1a<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7\">C++<\/span><span role=\"button\" tabindex=\"0\" data-code=\"template&lt;int N&gt;\nint foo() {\n    if (N == 1) return 1;\n    return N + foo&lt;N-1&gt;();\n}\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #569CD6\">template<\/span><span style=\"color: #D4D4D4\">&lt;<\/span><span style=\"color: #569CD6\">int<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4EC9B0\">N<\/span><span style=\"color: #D4D4D4\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">int<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">foo<\/span><span style=\"color: #D4D4D4\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #C586C0\">if<\/span><span style=\"color: #D4D4D4\"> (N == <\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">) <\/span><span style=\"color: #C586C0\">return<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #C586C0\">return<\/span><span style=\"color: #D4D4D4\"> N + <\/span><span style=\"color: #DCDCAA\">foo<\/span><span style=\"color: #D4D4D4\">&lt;<\/span><span style=\"color: #4EC9B0\">N<\/span><span style=\"color: #D4D4D4\">-<\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">&gt;();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u4e0a\u8ff0\u4ee3\u7801\u60f3\u8981\u5229\u7528\u6a21\u677f\u6c42\u89e31\u5230N\u4e4b\u548c\uff0c\u4f46\u662f\u7f16\u8bd1\u5668\u4f1a\u7ed9\u51fa\u6a21\u677f\u5b9e\u4f8b\u5316\u65f6\u8d85\u51fa\u9650\u5236\u7684\u62a5\u9519\uff08<code>template instantiation depth exceeds maximum of 900<\/code>\uff09\u3002\u8fd9\u662f\u7531\u4e8e\u5728\u5b9e\u4f8b\u5316 <code>foo&lt;N-1&gt;<\/code> \u65f6\uff0c\u6ca1\u6709\u7ed9\u5b9a\u7f16\u8bd1\u5668\u7684\u505c\u6b62\u6761\u4ef6\u3002<\/p>\n\n\n\n<p>\u5728 <code>C++17<\/code> \u4e4b\u524d\uff0c\u4e0a\u8ff0\u95ee\u9898\u53ef\u4ee5\u901a\u8fc7\u7279\u5316\u6a21\u677f\u6765\u89e3\u51b3\uff0c\u5982\u4e0b\u8ff0\u4ee3\u7801\u6240\u793a\uff1a<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7\">C++<\/span><span role=\"button\" tabindex=\"0\" data-code=\"template&lt;int N&gt;\nint foo() {\n    return N + foo&lt;N-1&gt;();\n}\ntemplate&lt;&gt;\nint foo&lt;1&gt;() {\n    return 1;\n}\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #569CD6\">template<\/span><span style=\"color: #D4D4D4\">&lt;<\/span><span style=\"color: #569CD6\">int<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4EC9B0\">N<\/span><span style=\"color: #D4D4D4\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">int<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">foo<\/span><span style=\"color: #D4D4D4\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #C586C0\">return<\/span><span style=\"color: #D4D4D4\"> N + <\/span><span style=\"color: #DCDCAA\">foo<\/span><span style=\"color: #D4D4D4\">&lt;<\/span><span style=\"color: #4EC9B0\">N<\/span><span style=\"color: #D4D4D4\">-<\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">&gt;();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">template<\/span><span style=\"color: #D4D4D4\">&lt;&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">int<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">foo<\/span><span style=\"color: #D4D4D4\">&lt;<\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">&gt;() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #C586C0\">return<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u4e0a\u8ff0\u4ee3\u7801\u5728 <code>N = 1<\/code> \u65f6\u7279\u5316\u4e86\u6a21\u677f\uff0c\u4e14\u8be5\u7279\u5316\u4e2d\u4e0d\u5305\u542b\u8fed\u4ee3\uff0c\u4ece\u800c\u4f7f\u5f97\u7f16\u8bd1\u5668\u53ef\u4ee5\u5728 <code>N = 1<\/code> \u65f6\u505c\u4e0b\u3002<\/p>\n\n\n\n<p>\u5728 <code>C++17<\/code> \u4e4b\u540e\uff0c\u4e0a\u8ff0\u95ee\u9898\u5219\u53ef\u4ee5\u4f7f\u7528 <code>if constexpr<\/code> \u6765\u89e3\u51b3\uff0c\u8be5\u6307\u4ee4\u7528\u4e8e\u5728\u7f16\u8bd1\u65f6\u5224\u65ad\u5206\u652f\u662f\u5426\u5e94\u8be5\u88ab\u629b\u5f03\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#2b2b2b;color:#c7c7c7\">C++<\/span><span role=\"button\" tabindex=\"0\" data-code=\"template&lt;int N&gt;\nint foo() {\n    if constexpr (N == 1) return 1;\n    else return N + foo&lt;N-1&gt;();\n}\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #569CD6\">template<\/span><span style=\"color: #D4D4D4\">&lt;<\/span><span style=\"color: #569CD6\">int<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4EC9B0\">N<\/span><span style=\"color: #D4D4D4\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">int<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">foo<\/span><span style=\"color: #D4D4D4\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #C586C0\">if<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">constexpr<\/span><span style=\"color: #D4D4D4\"> (N == <\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">) <\/span><span style=\"color: #C586C0\">return<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #C586C0\">else<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #C586C0\">return<\/span><span style=\"color: #D4D4D4\"> N + <\/span><span style=\"color: #DCDCAA\">foo<\/span><span style=\"color: #D4D4D4\">&lt;<\/span><span style=\"color: #4EC9B0\">N<\/span><span style=\"color: #D4D4D4\">-<\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">&gt;();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u9700\u8981\u6ce8\u610f\uff0c<code>else<\/code> \u5728\u8fd9\u91cc\u4e0d\u80fd\u7701\u7565\uff0c\u56e0\u4e3a <code>if constexpr<\/code> \u53ea\u80fd\u5bf9\u4e8e <code>if<\/code> \u548c <code>else<\/code> \u4e24\u4e2a\u5206\u652f\u8fdb\u884c\u5224\u65ad\uff0c\u5916\u90e8\u4ee3\u7801\u65e0\u6cd5\u5224\u65ad\u662f\u5426\u88ab\u629b\u5f03\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5355\u4e2a\u53c2\u6570\u5305\u7528\u4f5c\u6784\u9020\u51fd\u6570\u552f\u4e00\u53c2\u6570\u65f6\u53ef\u80fd\u5bfc\u81f4\u7684\u95ee\u9898<\/h2>\n\n\n\n<p>\u5728\u4f7f\u7528\u53c2\u6570\u5305\uff08parameter pack\uff09\u4f5c\u4e3a\u6784\u9020\u51fd\u6570\u7684\u552f\u4e00\u53c2\u6570\u65f6\uff0c\u9ed8\u8ba4\u62f7\u8d1d\u6784\u9020\u51fd\u6570\u5728\u8f93\u5165\u975econst\u65f6\u4f1a\u88ab\u5176\u8986\u76d6\uff0c\u53ef\u80fd\u5bfc\u81f4\u4e00\u4e9b\u96be\u4ee5\u6392\u67e5\u7684\u95ee\u9898\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u667a\u80fd\u6307\u9488\u4e0e\u666e\u901a\u6307\u9488\u7684\u4f7f\u7528<\/h2>\n\n\n\n<p>\u667a\u80fd\u6307\u9488\u7684\u4f5c\u7528\u5728\u4e8e\u7ba1\u7406\u6240\u6709\u6743\uff0c\u56e0\u6b64\u4e0d\u6d89\u53ca\u6240\u6709\u6743\u7684\u64cd\u4f5c\u4e0d\u5e94\u4f7f\u7528\u53ea\u80fd\u6307\u9488\u3002<\/p>\n\n\n\n<p>\u8fd9\u91cc\u7684\u6240\u6709\u6743\u6307\u7684\u662f\u80fd\u591f\u51b3\u5b9a\u6307\u9488\u6307\u5411\u7684\u5bf9\u8c61\u7684\u751f\u547d\u5468\u671f\u7684\u4ee3\u7801\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">std::set \/ std::map \u7684\u63d2\u5165<\/h2>\n\n\n\n<p>\u4e4b\u524d\u9519\u8bef\u7684\u4f7f\u7528<code>set<\/code>\u548c<code>map<\/code>\uff0c\u5148\u4f7f\u7528find\u5224\u65ad\u5143\u7d20\u662f\u5426\u5b58\u5728\uff0c\u4e0d\u5b58\u5728\u5219\u8fdb\u884c\u63d2\u5165\u5426\u5219\u8fdb\u884c\u5176\u4ed6\u64cd\u4f5c\uff0c\u5b9e\u9645\u4e0a\uff0cinsert\u51fd\u6570\u4f1a\u5728\u5185\u90e8\u8fdb\u884c\u76f8\u5173\u5224\u65ad\uff0c\u4e14\u5176\u8fd4\u56de\u503c\u4e3a\u4e00\u4e2apair\uff0c\u5176\u4e2d\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e3a\u63d2\u5165\u4f4d\u7f6e\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u4e3a\u662f\u5426\u63d2\u5165\u6210\u529f\uff0c\u56e0\u6b64\u53ea\u4f7f\u7528insert\u8fdb\u884c\u76f8\u5173\u5224\u65ad\u5373\u53ef\uff0c\u4e0d\u9700\u8981\u8c03\u7528find\u3002<\/p>\n\n\n\n<p>\u5e76\u4e14\uff0cmap\u7684operator[]\u5728\u5143\u7d20\u4e0d\u5b58\u5728\u65f6\u540c\u6837\u4f1a\u81ea\u52a8\u63d2\u5165\u5143\u7d20\uff0c\u65e0\u9700\u5224\u65ad\u662f\u5426\u5b58\u5728\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e0b\u5212\u7ebf\u5f00\u5934\u7684\u53d8\u91cf\u540d\u53ef\u80fd\u5bfc\u81f4\u7684\u95ee\u9898<\/h2>\n\n\n\n<p>\u6709\u4e9b\u547d\u540d\u89c4\u8303\u4f1a\u4f7f\u7528\u4e0b\u5212\u7ebf\u5f00\u5934\u7684\u53d8\u91cf\u8868\u793a\u79c1\u6709\u53d8\u91cf\uff0c\u4f46\u662fC++\u4e2d\uff0c\u4e0b\u5212\u7ebf\u3001\u53cc\u4e0b\u5212\u7ebf\u5f00\u5934\u7684\u53d8\u91cf\u5b9e\u9645\u4e0a\u662f\u4fdd\u7559\u7ed9C++\u5b9e\u73b0\u7684\uff08\u4f8b\u5982\u7f16\u8bd1\u5668\u3001\u6807\u51c6\u5e93\uff09\uff0c\u56e0\u6b64\u4f7f\u7528\u4ee5\u4e0b\u5212\u7ebf\u5f00\u5934\u7684\u53d8\u91cf\u540d\u53ef\u80fd\u4f1a\u5bfc\u81f4\u96be\u4ee5\u9884\u6599\u7684\u95ee\u9898\u3002\u8be6\u89c1<a href=\"https:\/\/stackoverflow.com\/a\/20496955\/11889237\">\u672c\u6587<\/a>\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6a21\u7248\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u7684\u4e00\u4e9b\u95ee\u9898<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u6a21\u7248\u6839\u636e\u8c03\u7528\u8fdb\u884c\u7f16\u8bd1\uff0c\u56e0\u6b64\u6ca1\u6709\u88ab\u8c03\u7528\u7684\uff08\u5168\u7279\u5316\u3001\u5b9e\u4f8b\u5316\uff09\u6a21\u7248\u5e76\u4e0d\u4f1a\u88ab\u7f16\u8bd1\uff0c\u8fd9\u4e5f\u5c31\u662f\u4e3a\u4ec0\u4e48\u6a21\u7248\u7684\u58f0\u660e\u548c\u5b9a\u4e49\u8981\u653e\u5728\u4e00\u8d77\u3002<\/li>\n\n\n\n<li>\u6a21\u7248\u6210\u5458\u51fd\u6570\u4e0d\u80fd\u4e3a\u865a\u51fd\u6570\uff08\u5982\u679c\u80fd\u662f\u865a\u51fd\u6570\uff0c\u57fa\u7c7b\u53ef\u80fd\u5e76\u6ca1\u6709\u8c03\u7528\u5bf9\u5e94\u7b7e\u540d\u7684\u6210\u5458\u51fd\u6570\uff0c\u56e0\u6b64\u57fa\u7c7b\u4e2d\u53ef\u80fd\u4e0d\u5b58\u5728\u8be5\u51fd\u6570\uff0c\u81ea\u7136\u65e0\u6cd5\u5b9e\u73b0\u91cd\u8f7d\uff09\u3002<\/li>\n\n\n\n<li>\u6a21\u7248\u5168\u7279\u5316\u65f6\uff0c\u9700\u8981\u8fdb\u884c\u58f0\u660e\u548c\u5b9a\u4e49\uff0c\u4e14\u5b9a\u4e49\u9700\u8981\u653e\u5165\u6e90\u6587\u4ef6\uff0c\u5426\u5219\u4f1a\u4e0eODR\u51b2\u7a81\u3002<\/li>\n\n\n\n<li>\u4e07\u80fd\u5f15\u7528\uff08\u65e7\u79f0\u4e3aUniversal Reference\uff0c\u76ee\u524d\u88ab\u79f0\u4e3aForwarding Reference\uff09\u53ea\u6709\u5728\u51fd\u6570\u6a21\u7248\u624d\u80fd\u89e6\u53d1\uff0c\u7c7b\u6a21\u7248\u65e0\u6cd5\u5b9e\u73b0\u4e07\u80fd\u5f15\u7528\u3002<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">\u5185\u5b58\u8d8a\u754c\u5bfc\u81f4\u7684\u95ee\u9898<\/h2>\n\n\n\n<p>\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u9047\u5230\u4e86malloc\u7684\u62a5\u9519\uff1a<code>malloc(): unsupported double linked list corrupted<\/code> \u3002<\/p>\n\n\n\n<p>\u8be5\u62a5\u9519\u4e3b\u8981\u662f\u7531\u4e8e\u5185\u5b58\u8d8a\u754c\u5bfc\u81f4\u7684\uff0c\u4e0d\u8fc7\u62a5\u9519\u4f4d\u7f6e\u53ef\u80fd\u5e76\u4e0d\u662f\u53d1\u751f\u8d8a\u754c\u7684\u4f4d\u7f6e\uff0c\u53cd\u800c\u4f1a\u53d1\u751f\u5728\u8d8a\u754c\u540e\uff0c\u5bf9\u5806\u8fdb\u884c\u5206\u914d\u7684\u65f6\u5019\u3002<\/p>\n\n\n\n<p>\u8fd9\u662f\u56e0\u4e3a\uff0c\u5728\u5185\u5b58\u8d8a\u754c\u65f6\uff0c\u8d8a\u754c\u6570\u636e\u8986\u76d6\u6389\u4e86\u7528\u4e8e\u7ba1\u7406\u5806\u7684\u6570\u636e\uff08\u5728\u8fd9\u4e2a\u60c5\u51b5\u4e0b\uff0c\u5373\u8986\u76d6\u6389\u4e86\u7528\u4e8e\u7ba1\u7406\u5806\u7684\u53cc\u5411\u94fe\u8868\u7684\u6570\u636e\uff09\uff0c\u4ece\u800c\u5bfc\u81f4\u4e0b\u6b21\u9700\u8981\u8fdb\u884c\u5206\u914d\u65f6\uff0c\u65e0\u6cd5\u83b7\u53d6\u7ba1\u7406\u6570\u636e\u3002<\/p>\n\n\n\n<p>\u7531\u4e8e\u8be5\u95ee\u9898\u6d89\u53ca\u5230\u5185\u5b58\u5206\u914d\uff0c\u56e0\u6b64\u53d1\u751f\u4f4d\u7f6e\u53ef\u80fd\u4e0d\u56fa\u5b9a\uff0c\u4e0d\u8fc7\u53ef\u4ee5\u901a\u8fc7\u591a\u6b21\u62a5\u9519\u7684\u8c03\u7528\u6808\uff0c\u5b9a\u4f4d\u76f8\u540c\u7684\u8c03\u7528\u8def\u5f84\uff0c\u6765\u63a8\u65ad\u53d1\u751f\u8d8a\u754c\u7684\u5927\u81f4\u4f4d\u7f6e\uff0c\u56e0\u4e3a\u5b58\u5728\u76f8\u540c\u8def\u5f84\uff0c\u5373\u610f\u5473\u7740\u8d8a\u754c\u5927\u6982\u7387\u53d1\u751f\u5728\u76f8\u540c\u8def\u5f84\u4e4b\u540e\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6ca1\u5199\u8fd4\u56de\u8bed\u53e5\u5bfc\u81f4\u7684\u672a\u5b9a\u4e49\u884c\u4e3a<\/h2>\n\n\n\n<p>\u5982\u679c\u4e00\u4e2a\u51fd\u6570\u5b9a\u4e49\u5b58\u5728\u8fd4\u56de\u503c\uff0c\u4f46\u662f\u8be5\u51fd\u6570\u672c\u8eab\u6ca1\u6709\u6267\u884c\u8fd4\u56de\u8bed\u53e5\uff0c\u90a3\u4e48\u4f1a\u5bfc\u81f4\u672a\u5b9a\u4e49\u884c\u4e3a\u3002<\/p>\n\n\n\n<p>\u56e0\u4e3a\u5982\u679c\u6ca1\u6709\u6267\u884c\u8fd4\u56de\u8bed\u53e5\uff0c\u90a3\u4e48\u51fd\u6570\u7684\u8fd4\u56de\u503c\u53ef\u4ee5\u89c6\u4e3a\u91ce\u6307\u9488\u3002\u6b64\u65f6\uff0c\u51fd\u6570\u7684\u8fd4\u56de\u503c\u5982\u679c\u88ab\u91ca\u653e\uff0c\u5c31\u4f1a\u51fa\u73b0\u672a\u5b9a\u4e49\u7684\u884c\u4e3a\u3002<\/p>\n\n\n\n<p>\u8fd9\u79cd\u95ee\u9898\u5bfc\u81f4\u7684\u62a5\u9519\u5343\u5947\u767e\u602a\uff0c\u9700\u8981\u683c\u5916\u6ce8\u610f\u68c0\u67e5\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8bb0\u5f55\u4e00\u4e9bC++\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u9047\u5230\u7684\u4e00\u4e9b\u6613\u9519\u95ee\u9898\uff0c\u957f\u671f\u66f4\u65b0<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","wikipediapreview_detectlinks":true,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[7],"tags":[8,10,9],"class_list":["post-109","post","type-post","status-publish","format-standard","hentry","category-cpp","tag-c","tag-10","tag-9"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>C++\u5f00\u53d1\u65f6\u9047\u5230\u7684\u6613\u9519\u70b9 - UltBlog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ultserver.com\/blog\/cpp\/cpp\u5f00\u53d1\u65f6\u9047\u5230\u7684\u6613\u9519\u70b9\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C++\u5f00\u53d1\u65f6\u9047\u5230\u7684\u6613\u9519\u70b9 - UltBlog\" \/>\n<meta property=\"og:description\" content=\"\u8bb0\u5f55\u4e00\u4e9bC++\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u9047\u5230\u7684\u4e00\u4e9b\u6613\u9519\u95ee\u9898\uff0c\u957f\u671f\u66f4\u65b0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ultserver.com\/blog\/cpp\/cpp\u5f00\u53d1\u65f6\u9047\u5230\u7684\u6613\u9519\u70b9\/\" \/>\n<meta property=\"og:site_name\" content=\"UltBlog\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-11T14:57:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-27T01:23:55+00:00\" \/>\n<meta name=\"author\" content=\"Ultcrt\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ultcrt\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/cpp\\\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/cpp\\\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\\\/\"},\"author\":{\"name\":\"Ultcrt\",\"@id\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/#\\\/schema\\\/person\\\/7e56085265669846c542f2b5790feab2\"},\"headline\":\"C++\u5f00\u53d1\u65f6\u9047\u5230\u7684\u6613\u9519\u70b9\",\"datePublished\":\"2024-03-11T14:57:32+00:00\",\"dateModified\":\"2024-12-27T01:23:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/cpp\\\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\\\/\"},\"wordCount\":69,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/#\\\/schema\\\/person\\\/7e56085265669846c542f2b5790feab2\"},\"keywords\":[\"C++\u9677\u9631\",\"\u957f\u671f\u66f4\u65b0\",\"\u95ee\u9898\u6392\u67e5\"],\"articleSection\":[\"C++\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/ultserver.com\\\/blog\\\/cpp\\\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/cpp\\\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\\\/\",\"url\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/cpp\\\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\\\/\",\"name\":\"C++\u5f00\u53d1\u65f6\u9047\u5230\u7684\u6613\u9519\u70b9 - UltBlog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/#website\"},\"datePublished\":\"2024-03-11T14:57:32+00:00\",\"dateModified\":\"2024-12-27T01:23:55+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/cpp\\\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\\\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ultserver.com\\\/blog\\\/cpp\\\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/cpp\\\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C++\u5f00\u53d1\u65f6\u9047\u5230\u7684\u6613\u9519\u70b9\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/\",\"name\":\"UltBlog\",\"description\":\"Ultcrt\u7684\u4e2a\u4eba\u535a\u5ba2\",\"publisher\":{\"@id\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/#\\\/schema\\\/person\\\/7e56085265669846c542f2b5790feab2\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/#\\\/schema\\\/person\\\/7e56085265669846c542f2b5790feab2\",\"name\":\"Ultcrt\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/LOGOv1.1.5-Transparent.png\",\"url\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/LOGOv1.1.5-Transparent.png\",\"contentUrl\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/LOGOv1.1.5-Transparent.png\",\"width\":800,\"height\":600,\"caption\":\"Ultcrt\"},\"logo\":{\"@id\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/LOGOv1.1.5-Transparent.png\"},\"description\":\"\u70ed\u7231\u5f00\u53d1\u548c\u6e38\u620f\",\"sameAs\":[\"https:\\\/\\\/ultserver.com\\\/blog\"],\"url\":\"https:\\\/\\\/ultserver.com\\\/blog\\\/author\\\/ultcrt\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C++\u5f00\u53d1\u65f6\u9047\u5230\u7684\u6613\u9519\u70b9 - UltBlog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ultserver.com\/blog\/cpp\/cpp\u5f00\u53d1\u65f6\u9047\u5230\u7684\u6613\u9519\u70b9\/","og_locale":"zh_CN","og_type":"article","og_title":"C++\u5f00\u53d1\u65f6\u9047\u5230\u7684\u6613\u9519\u70b9 - UltBlog","og_description":"\u8bb0\u5f55\u4e00\u4e9bC++\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u9047\u5230\u7684\u4e00\u4e9b\u6613\u9519\u95ee\u9898\uff0c\u957f\u671f\u66f4\u65b0","og_url":"https:\/\/ultserver.com\/blog\/cpp\/cpp\u5f00\u53d1\u65f6\u9047\u5230\u7684\u6613\u9519\u70b9\/","og_site_name":"UltBlog","article_published_time":"2024-03-11T14:57:32+00:00","article_modified_time":"2024-12-27T01:23:55+00:00","author":"Ultcrt","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"Ultcrt","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ultserver.com\/blog\/cpp\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\/#article","isPartOf":{"@id":"https:\/\/ultserver.com\/blog\/cpp\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\/"},"author":{"name":"Ultcrt","@id":"https:\/\/ultserver.com\/blog\/#\/schema\/person\/7e56085265669846c542f2b5790feab2"},"headline":"C++\u5f00\u53d1\u65f6\u9047\u5230\u7684\u6613\u9519\u70b9","datePublished":"2024-03-11T14:57:32+00:00","dateModified":"2024-12-27T01:23:55+00:00","mainEntityOfPage":{"@id":"https:\/\/ultserver.com\/blog\/cpp\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\/"},"wordCount":69,"commentCount":1,"publisher":{"@id":"https:\/\/ultserver.com\/blog\/#\/schema\/person\/7e56085265669846c542f2b5790feab2"},"keywords":["C++\u9677\u9631","\u957f\u671f\u66f4\u65b0","\u95ee\u9898\u6392\u67e5"],"articleSection":["C++"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ultserver.com\/blog\/cpp\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ultserver.com\/blog\/cpp\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\/","url":"https:\/\/ultserver.com\/blog\/cpp\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\/","name":"C++\u5f00\u53d1\u65f6\u9047\u5230\u7684\u6613\u9519\u70b9 - UltBlog","isPartOf":{"@id":"https:\/\/ultserver.com\/blog\/#website"},"datePublished":"2024-03-11T14:57:32+00:00","dateModified":"2024-12-27T01:23:55+00:00","breadcrumb":{"@id":"https:\/\/ultserver.com\/blog\/cpp\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ultserver.com\/blog\/cpp\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ultserver.com\/blog\/cpp\/cpp%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e6%98%93%e9%94%99%e7%82%b9\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/ultserver.com\/blog\/"},{"@type":"ListItem","position":2,"name":"C++\u5f00\u53d1\u65f6\u9047\u5230\u7684\u6613\u9519\u70b9"}]},{"@type":"WebSite","@id":"https:\/\/ultserver.com\/blog\/#website","url":"https:\/\/ultserver.com\/blog\/","name":"UltBlog","description":"Ultcrt\u7684\u4e2a\u4eba\u535a\u5ba2","publisher":{"@id":"https:\/\/ultserver.com\/blog\/#\/schema\/person\/7e56085265669846c542f2b5790feab2"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ultserver.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/ultserver.com\/blog\/#\/schema\/person\/7e56085265669846c542f2b5790feab2","name":"Ultcrt","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/ultserver.com\/blog\/wp-content\/uploads\/2024\/03\/LOGOv1.1.5-Transparent.png","url":"https:\/\/ultserver.com\/blog\/wp-content\/uploads\/2024\/03\/LOGOv1.1.5-Transparent.png","contentUrl":"https:\/\/ultserver.com\/blog\/wp-content\/uploads\/2024\/03\/LOGOv1.1.5-Transparent.png","width":800,"height":600,"caption":"Ultcrt"},"logo":{"@id":"https:\/\/ultserver.com\/blog\/wp-content\/uploads\/2024\/03\/LOGOv1.1.5-Transparent.png"},"description":"\u70ed\u7231\u5f00\u53d1\u548c\u6e38\u620f","sameAs":["https:\/\/ultserver.com\/blog"],"url":"https:\/\/ultserver.com\/blog\/author\/ultcrt\/"}]}},"spectra_custom_meta":{"_edit_lock":["1735262644:1"],"_wp_old_slug":["c%e5%bc%80%e5%8f%91%e6%97%b6%e9%81%87%e5%88%b0%e7%9a%84%e4%b8%80%e4%ba%9b%e9%9a%be%e4%bb%a5%e6%8e%92%e6%9f%a5%e7%9a%84%e9%94%99%e8%af%af"],"_edit_last":["1"],"_yoast_wpseo_primary_category":["7"],"_yoast_wpseo_content_score":["90"],"_yoast_wpseo_estimated-reading-time-minutes":["1"],"_yoast_wpseo_wordproof_timestamp":[""],"_uagb_toc_options":["a:2:{s:17:\"_uagb_toc_version\";s:10:\"1777915058\";s:18:\"_uagb_toc_headings\";a:13:{i:0;a:4:{s:5:\"level\";i:2;s:2:\"id\";s:14:\"auto-\u5173\u952e\u5b57\";s:7:\"content\";s:14:\"auto \u5173\u952e\u5b57\";s:5:\"depth\";i:2;}i:1;a:4:{s:5:\"level\";i:2;s:2:\"id\";s:30:\"\u51fd\u6570\u8fd4\u56de\u503c\u4e3a\u667a\u80fd\u6307\u9488\";s:7:\"content\";s:30:\"\u51fd\u6570\u8fd4\u56de\u503c\u4e3a\u667a\u80fd\u6307\u9488\";s:5:\"depth\";i:2;}i:2;a:4:{s:5:\"level\";i:2;s:2:\"id\";s:25:\"size-t-\u4f5c\u4e3a\u5faa\u73af\u53d8\u91cf\";s:7:\"content\";s:25:\"size_t \u4f5c\u4e3a\u5faa\u73af\u53d8\u91cf\";s:5:\"depth\";i:2;}i:3;a:4:{s:5:\"level\";i:2;s:2:\"id\";s:28:\"inline-\u5173\u952e\u5b57\u7684\u8bef\u5bfc\u6027\";s:7:\"content\";s:28:\"inline \u5173\u952e\u5b57\u7684\u8bef\u5bfc\u6027\";s:5:\"depth\";i:2;}i:4;a:4:{s:5:\"level\";i:2;s:2:\"id\";s:27:\"\u7c7b\u6210\u5458\u7684\u521d\u59cb\u5316\u987a\u5e8f\";s:7:\"content\";s:27:\"\u7c7b\u6210\u5458\u7684\u521d\u59cb\u5316\u987a\u5e8f\";s:5:\"depth\";i:2;}i:5;a:4:{s:5:\"level\";i:2;s:2:\"id\";s:30:\"\u6a21\u677f\u8d85\u51fa\u6700\u5927\u9012\u5f52\u9650\u5236\";s:7:\"content\";s:30:\"\u6a21\u677f\u8d85\u51fa\u6700\u5927\u9012\u5f52\u9650\u5236\";s:5:\"depth\";i:2;}i:6;a:4:{s:5:\"level\";i:2;s:2:\"id\";s:69:\"\u5355\u4e2a\u53c2\u6570\u5305\u7528\u4f5c\u6784\u9020\u51fd\u6570\u552f\u4e00\u53c2\u6570\u65f6\u53ef\u80fd\u5bfc\u81f4\u7684\u95ee\u9898\";s:7:\"content\";s:69:\"\u5355\u4e2a\u53c2\u6570\u5305\u7528\u4f5c\u6784\u9020\u51fd\u6570\u552f\u4e00\u53c2\u6570\u65f6\u53ef\u80fd\u5bfc\u81f4\u7684\u95ee\u9898\";s:5:\"depth\";i:2;}i:7;a:4:{s:5:\"level\";i:2;s:2:\"id\";s:36:\"\u667a\u80fd\u6307\u9488\u4e0e\u666e\u901a\u6307\u9488\u7684\u4f7f\u7528\";s:7:\"content\";s:36:\"\u667a\u80fd\u6307\u9488\u4e0e\u666e\u901a\u6307\u9488\u7684\u4f7f\u7528\";s:5:\"depth\";i:2;}i:8;a:4:{s:5:\"level\";i:2;s:2:\"id\";s:23:\"stdset-stdmap-\u7684\u63d2\u5165\";s:7:\"content\";s:29:\"std::set \/ std::map \u7684\u63d2\u5165\";s:5:\"depth\";i:2;}i:9;a:4:{s:5:\"level\";i:2;s:2:\"id\";s:48:\"\u4e0b\u5212\u7ebf\u5f00\u5934\u7684\u53d8\u91cf\u540d\u53ef\u80fd\u5bfc\u81f4\u7684\u95ee\u9898\";s:7:\"content\";s:48:\"\u4e0b\u5212\u7ebf\u5f00\u5934\u7684\u53d8\u91cf\u540d\u53ef\u80fd\u5bfc\u81f4\u7684\u95ee\u9898\";s:5:\"depth\";i:2;}i:10;a:4:{s:5:\"level\";i:2;s:2:\"id\";s:39:\"\u6a21\u7248\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u7684\u4e00\u4e9b\u95ee\u9898\";s:7:\"content\";s:39:\"\u6a21\u7248\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u7684\u4e00\u4e9b\u95ee\u9898\";s:5:\"depth\";i:2;}i:11;a:4:{s:5:\"level\";i:2;s:2:\"id\";s:27:\"\u5185\u5b58\u8d8a\u754c\u5bfc\u81f4\u7684\u95ee\u9898\";s:7:\"content\";s:27:\"\u5185\u5b58\u8d8a\u754c\u5bfc\u81f4\u7684\u95ee\u9898\";s:5:\"depth\";i:2;}i:12;a:4:{s:5:\"level\";i:2;s:2:\"id\";s:42:\"\u6ca1\u5199\u8fd4\u56de\u8bed\u53e5\u5bfc\u81f4\u7684\u672a\u5b9a\u4e49\u884c\u4e3a\";s:7:\"content\";s:42:\"\u6ca1\u5199\u8fd4\u56de\u8bed\u53e5\u5bfc\u81f4\u7684\u672a\u5b9a\u4e49\u884c\u4e3a\";s:5:\"depth\";i:2;}}}"],"_uagb_previous_block_counts":["a:90:{s:21:\"uagb\/advanced-heading\";i:0;s:15:\"uagb\/blockquote\";i:0;s:12:\"uagb\/buttons\";i:0;s:18:\"uagb\/buttons-child\";i:0;s:19:\"uagb\/call-to-action\";i:0;s:15:\"uagb\/cf7-styler\";i:0;s:11:\"uagb\/column\";i:0;s:12:\"uagb\/columns\";i:0;s:14:\"uagb\/container\";i:0;s:21:\"uagb\/content-timeline\";i:0;s:27:\"uagb\/content-timeline-child\";i:0;s:14:\"uagb\/countdown\";i:0;s:12:\"uagb\/counter\";i:0;s:8:\"uagb\/faq\";i:0;s:14:\"uagb\/faq-child\";i:0;s:10:\"uagb\/forms\";i:0;s:17:\"uagb\/forms-accept\";i:0;s:19:\"uagb\/forms-checkbox\";i:0;s:15:\"uagb\/forms-date\";i:0;s:16:\"uagb\/forms-email\";i:0;s:17:\"uagb\/forms-hidden\";i:0;s:15:\"uagb\/forms-name\";i:0;s:16:\"uagb\/forms-phone\";i:0;s:16:\"uagb\/forms-radio\";i:0;s:17:\"uagb\/forms-select\";i:0;s:19:\"uagb\/forms-textarea\";i:0;s:17:\"uagb\/forms-toggle\";i:0;s:14:\"uagb\/forms-url\";i:0;s:14:\"uagb\/gf-styler\";i:0;s:15:\"uagb\/google-map\";i:0;s:11:\"uagb\/how-to\";i:0;s:16:\"uagb\/how-to-step\";i:0;s:9:\"uagb\/icon\";i:0;s:14:\"uagb\/icon-list\";i:0;s:20:\"uagb\/icon-list-child\";i:0;s:10:\"uagb\/image\";i:0;s:18:\"uagb\/image-gallery\";i:0;s:13:\"uagb\/info-box\";i:0;s:18:\"uagb\/inline-notice\";i:0;s:11:\"uagb\/lottie\";i:0;s:21:\"uagb\/marketing-button\";i:0;s:10:\"uagb\/modal\";i:0;s:18:\"uagb\/popup-builder\";i:0;s:16:\"uagb\/post-button\";i:0;s:18:\"uagb\/post-carousel\";i:0;s:17:\"uagb\/post-excerpt\";i:0;s:14:\"uagb\/post-grid\";i:0;s:15:\"uagb\/post-image\";i:0;s:17:\"uagb\/post-masonry\";i:0;s:14:\"uagb\/post-meta\";i:0;s:18:\"uagb\/post-taxonomy\";i:0;s:18:\"uagb\/post-timeline\";i:0;s:15:\"uagb\/post-title\";i:0;s:20:\"uagb\/restaurant-menu\";i:0;s:26:\"uagb\/restaurant-menu-child\";i:0;s:11:\"uagb\/review\";i:0;s:12:\"uagb\/section\";i:0;s:14:\"uagb\/separator\";i:0;s:11:\"uagb\/slider\";i:0;s:17:\"uagb\/slider-child\";i:0;s:17:\"uagb\/social-share\";i:0;s:23:\"uagb\/social-share-child\";i:0;s:16:\"uagb\/star-rating\";i:0;s:23:\"uagb\/sure-cart-checkout\";i:0;s:22:\"uagb\/sure-cart-product\";i:0;s:15:\"uagb\/sure-forms\";i:0;s:22:\"uagb\/table-of-contents\";i:0;s:9:\"uagb\/tabs\";i:0;s:15:\"uagb\/tabs-child\";i:0;s:18:\"uagb\/taxonomy-list\";i:0;s:9:\"uagb\/team\";i:0;s:16:\"uagb\/testimonial\";i:0;s:14:\"uagb\/wp-search\";i:0;s:19:\"uagb\/instagram-feed\";i:0;s:10:\"uagb\/login\";i:0;s:17:\"uagb\/loop-builder\";i:0;s:18:\"uagb\/loop-category\";i:0;s:20:\"uagb\/loop-pagination\";i:0;s:15:\"uagb\/loop-reset\";i:0;s:16:\"uagb\/loop-search\";i:0;s:14:\"uagb\/loop-sort\";i:0;s:17:\"uagb\/loop-wrapper\";i:0;s:13:\"uagb\/register\";i:0;s:19:\"uagb\/register-email\";i:0;s:24:\"uagb\/register-first-name\";i:0;s:23:\"uagb\/register-last-name\";i:0;s:22:\"uagb\/register-password\";i:0;s:30:\"uagb\/register-reenter-password\";i:0;s:19:\"uagb\/register-terms\";i:0;s:22:\"uagb\/register-username\";i:0;}"],"_uag_css_file_name":["uag-css-109.css"],"_uag_js_file_name":["uag-js-109.js"],"_uag_page_assets":["a:9:{s:3:\"css\";s:6198:\".uag-blocks-common-selector{z-index:var(--z-index-desktop) !important}@media(max-width: 976px){.uag-blocks-common-selector{z-index:var(--z-index-tablet) !important}}@media(max-width: 767px){.uag-blocks-common-selector{z-index:var(--z-index-mobile) !important}}\ufeff.wp-block-uagb-table-of-contents .uagb-toc__wrap{display:inline-block;max-width:-moz-available;max-width:-webkit-fill-available;max-width:fill-available}.wp-block-uagb-table-of-contents li.uagb-toc__list{padding-top:10px}.wp-block-uagb-table-of-contents ul.uagb-toc__list,.wp-block-uagb-table-of-contents ol.uagb-toc__list{list-style-position:inside;padding-left:0;margin-bottom:0;margin-left:2.2em}.wp-block-uagb-table-of-contents ul.uagb-toc__list li,.wp-block-uagb-table-of-contents ol.uagb-toc__list li{margin:0}.wp-block-uagb-table-of-contents ul li:empty{display:none}.wp-block-uagb-table-of-contents .uagb-toc__title-wrap{display:flex;align-items:center}.wp-block-uagb-table-of-contents .uagb-toc__title{display:flex;align-items:center}.wp-block-uagb-table-of-contents .uagb-toc__is-collapsible.uagb-toc__title-wrap{cursor:pointer}.wp-block-uagb-table-of-contents .uag-toc__collapsible-wrap svg{width:20px;height:20px}.wp-block-uagb-table-of-contents svg{width:20px;height:20px;display:inline-block;margin-left:10px;cursor:pointer}.wp-block-uagb-table-of-contents .uag-toc__collapsible-wrap{display:flex;margin-left:10px;cursor:pointer}.wp-block-uagb-table-of-contents.uagb-toc__collapse .uagb-toc__list-wrap{display:none}.wp-block-uagb-table-of-contents.uagb-toc__collapse--list ul.uagb-toc__list,.wp-block-uagb-table-of-contents.uagb-toc__collapse--list ol.uagb-toc__list{padding-left:2px}ol.uagb-toc__list li.uagb-toc__list ul,ol.uagb-toc__list ul.uagb-toc__list ul{list-style-type:circle}ol.uagb-toc__list>ul,ol.uagb-toc__list>li{list-style-type:disc}.uagb-toc__scroll-top{position:fixed;right:50px;bottom:50px;display:none;padding:10px;background:#ccd0d4;cursor:pointer;font-size:1rem;line-height:1.8571428571}.uagb-toc__scroll-top svg{width:1.6em;height:.6em;margin-left:0;transform:translate(0, -20%) rotate(180deg);fill:currentColor}.uagb-toc__scroll-top.uagb-toc__show-scroll{display:inline-table}body[class*=astra] .uagb-toc__list{line-height:normal}.uagb-toc__list{margin-top:0}.wp-block-uagb-table-of-contents ol.uagb-toc__list li.uagb-toc__list.uagb-toc__list--expandable{list-style-type:none !important}ul.uagb-toc__list--child-of-closed-list{padding-top:0 !important}ul.uagb-toc__list--hidden-child{display:none !important}.list-open::before,.list-collapsed::before{content:\"\u25bc\"\/\"\";transition:transform .3s ease;transform:scale(0.7) translateX(-50%);display:inline-block}.list-collapsed::before{transform:scale(0.7) rotate(-90deg) translate(-84%, 6%)}span.list-open,span.list-collapsed{cursor:pointer;outline:none !important}.uagb-toc__list.transition{transition:max-height 300ms ease-in-out,padding-top 300ms ease-in-out}.uagb-toc__loader{border:2px solid #f3f3f3;border-top:2px solid #0073aa;border-radius:50%;width:20px;height:20px;animation:spin 1.1s linear infinite;display:block;position:absolute;margin-top:5px}.uagb-toc__list-hidden{opacity:0}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}[dir=rtl] .list-open::before{transform:scale(0.7) translateX(50%)}[dir=rtl] .list-collapsed::before{transform:scale(0.7) rotate(90deg) translate(84%, 6%)}[dir=rtl] .wp-block-uagb-table-of-contents.uagb-toc__collapse--list ul.uagb-toc__list,[dir=rtl] .wp-block-uagb-table-of-contents.uagb-toc__collapse--list ol.uagb-toc__list{padding-left:0;padding-right:2px;margin-left:0;margin-right:2.2em}.uagb-block-0cf44a2b.wp-block-uagb-table-of-contents{text-align: left;}.uagb-block-0cf44a2b .uagb-toc__list-wrap li a:hover{color: #000000;}.uagb-block-0cf44a2b .uagb-toc__list-wrap li a{color: #a00000;}.uagb-block-0cf44a2b .uagb-toc__wrap .uagb-toc__title-wrap{justify-content: left;}.uagb-block-0cf44a2b .uagb-toc__wrap .uagb-toc__title{color: #000000;justify-content: space-between;cursor: pointer;}.uagb-block-0cf44a2b .uagb-toc__wrap{border-top-left-radius: 6px;border-top-right-radius: 6px;border-bottom-left-radius: 6px;border-bottom-right-radius: 6px;border-color: #333;border-style: none;padding-left: 30px;padding-right: 30px;padding-top: 30px;padding-bottom: 30px;background: #ffffff;width: 100%;}.uagb-block-0cf44a2b .uagb-toc__list-wrap{column-count: 1;overflow: hidden;text-align: left;}.uagb-block-0cf44a2b .uagb-toc__list-wrap > ul.uagb-toc__list > li:first-child{padding-top: 0;}.uagb-block-0cf44a2b .uagb-toc__list-wrap ol.uagb-toc__list:first-child{margin-left: 0px;margin-right: 0px;margin-top: 0px;margin-bottom: 0px;}.uagb-block-0cf44a2b .uagb-toc__list-wrap ul.uagb-toc__list:last-child > li:last-child{padding-bottom: 0;}.uagb-block-0cf44a2b .uag-toc__collapsible-wrap svg{fill: #000000;}.uagb-block-0cf44a2b svg{fill: #000000;}.uagb-block-0cf44a2b .uagb-toc__list-wrap ol.uagb-toc__list > li{padding-top: calc( 0px \/ 2 );padding-bottom: calc( 0px \/ 2 );}.uagb-block-0cf44a2b .uagb-toc__list-wrap ul.uagb-toc__list > li{padding-top: calc( 0px \/ 2 );padding-bottom: calc( 0px \/ 2 );}.uagb-block-0cf44a2b .uagb-toc__list-wrap li.uagb-toc__list.uagb-toc__list--expandable > ul.uagb-toc__list{padding-top: calc( 0px \/ 2 );}.uagb-block-0cf44a2b .uagb-toc__list .uagb-toc__list{list-style-type: disc !important;}.uagb-block-0cf44a2b .uagb-toc__title{font-weight: Default;font-size: 20px;}@media only screen and (max-width: 976px) {.uagb-block-0cf44a2b .uagb-toc__wrap{border-style: none;}.uagb-block-0cf44a2b .uagb-toc__list-wrap{column-count: 1;overflow: hidden;text-align: left;}.uagb-block-0cf44a2b .uagb-toc__list-wrap > ul.uagb-toc__list > li:first-child{padding-top: 0;}.uagb-block-0cf44a2b .uagb-toc__list-wrap ul.uagb-toc__list:last-child > li:last-child{padding-bottom: 0;}}@media only screen and (max-width: 767px) {.uagb-block-0cf44a2b .uagb-toc__wrap{border-style: none;}.uagb-block-0cf44a2b .uagb-toc__list-wrap{column-count: 1;overflow: hidden;text-align: left;}.uagb-block-0cf44a2b .uagb-toc__list-wrap > ul.uagb-toc__list > li:first-child{padding-top: 0;}.uagb-block-0cf44a2b .uagb-toc__list-wrap ul.uagb-toc__list:last-child > li:last-child{padding-bottom: 0;}}\";s:2:\"js\";s:382:\"document.addEventListener(\"DOMContentLoaded\", function(){ window.addEventListener( 'load', function(){\n\tUAGBTableOfContents._run( {\"mappingHeaders\":[true,true,true,true,true,true],\"scrollToTop\":false,\"makeCollapsible\":true,\"enableCollapsableList\":false,\"initialCollapse\":false,\"markerView\":\"disc\",\"isFrontend\":true,\"initiallyCollapseList\":false}, '.uagb-block-0cf44a2b' );\n} );\n });\";s:18:\"current_block_list\";a:17:{i:0;s:12:\"core\/heading\";i:1;s:14:\"core\/paragraph\";i:2;s:27:\"kevinbatdorf\/code-block-pro\";i:3;s:10:\"core\/quote\";i:4;s:9:\"core\/list\";i:5;s:14:\"core\/list-item\";i:6;s:11:\"core\/search\";i:7;s:10:\"core\/group\";i:8;s:17:\"core\/latest-posts\";i:9;s:20:\"core\/latest-comments\";i:10;s:13:\"core\/archives\";i:11;s:15:\"core\/categories\";i:12;s:14:\"core\/page-list\";i:13;s:10:\"core\/embed\";i:15;s:18:\"core\/legacy-widget\";i:16;s:22:\"uagb\/table-of-contents\";i:17;s:25:\"uagb\/animations-extension\";}s:8:\"uag_flag\";b:1;s:11:\"uag_version\";s:10:\"1777915058\";s:6:\"gfonts\";a:0:{}s:10:\"gfonts_url\";s:0:\"\";s:12:\"gfonts_files\";a:0:{}s:14:\"uag_faq_layout\";b:0;}"]},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Ultcrt","author_link":"https:\/\/ultserver.com\/blog\/author\/ultcrt\/"},"uagb_comment_info":1,"uagb_excerpt":"\u8bb0\u5f55\u4e00\u4e9bC++\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u9047\u5230\u7684\u4e00\u4e9b\u6613\u9519\u95ee\u9898\uff0c\u957f\u671f\u66f4\u65b0","_links":{"self":[{"href":"https:\/\/ultserver.com\/blog\/wp-json\/wp\/v2\/posts\/109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ultserver.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ultserver.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ultserver.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ultserver.com\/blog\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":10,"href":"https:\/\/ultserver.com\/blog\/wp-json\/wp\/v2\/posts\/109\/revisions"}],"predecessor-version":[{"id":593,"href":"https:\/\/ultserver.com\/blog\/wp-json\/wp\/v2\/posts\/109\/revisions\/593"}],"wp:attachment":[{"href":"https:\/\/ultserver.com\/blog\/wp-json\/wp\/v2\/media?parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ultserver.com\/blog\/wp-json\/wp\/v2\/categories?post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ultserver.com\/blog\/wp-json\/wp\/v2\/tags?post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}