File tree 7 files changed +535
-5
lines changed
7 files changed +535
-5
lines changed Original file line number Diff line number Diff line change @@ -1716,6 +1716,7 @@ <h2 id="_9">救命!为什么我的全局函数不能作为函数对象?</h2>
1716
1716
< p > < img src ="../img/awesomeface.png " height ="30px " width ="auto " style ="margin: 0; border: none "/> 建议修改标准库,把小彭老师这两个真正好用的宏塞到 < code > <utility></ code > 和 < code > <functional></ code > 里,作为 C++26 标准的一部分。</ p >
1717
1717
</ blockquote >
1718
1718
< h2 id ="map-any "> map + any 外挂属性</ h2 >
1719
+ < p > TODO</ p >
1719
1720
< h2 id ="shared_ptr-deleter "> 自定义 shared_ptr 的 deleter</ h2 >
1720
1721
< h2 id ="check_cuda "> CHECK_CUDA 类错误检测宏</ h2 >
1721
1722
< h2 id ="_10 "> 函数默认参数求值的位置是调用者</ h2 >
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -776,7 +776,7 @@ <h2 id="_6">跨接口的适配器</h2>
776
776
};
777
777
</ code > </ pre >
778
778
< p > 他们要求的用法是先判断 hasNext(),然后才能调用 getNext 读取出真正的值。小彭老师设计了一个 Poost 适配器,把 PoostInputer 翻译成我们的 Inputer:</ p >
779
- < pre > < code class ="language-cpp "> struct PoostInputerAdapter {
779
+ < pre > < code class ="language-cpp "> struct PoostInputerAdapter : Inputer {
780
780
PoostInputer *poostIn;
781
781
782
782
PoostInputerAdapter(PoostInputer *poostIn)
Original file line number Diff line number Diff line change @@ -276,7 +276,7 @@ <h2 id="_1">前言</h2>
276
276
< blockquote >
277
277
< p > < img src ="./img/bulb.png " height ="30px " width ="auto " style ="margin: 0; border: none "/> 本书还在持续更新中……要追番的话,可以在 < a href ="https://github.com/parallel101/cppguidebook "> GitHub</ a > 点一下右上角的 “Watch” 按钮,每当小彭老师提交新 commit,GitHub 会向你发送一封电子邮件,提醒你小彭老师更新了。</ p >
278
278
</ blockquote >
279
- < p > 更新时间:2024年08月28日 23:08:04 (UTC+08:00)</ p >
279
+ < p > 更新时间:2024年08月30日 17:36:18 (UTC+08:00)</ p >
280
280
< p > < a href ="https://parallel101.github.io/cppguidebook "> 在 GitHub Pages 浏览本书</ a > | < a href ="https://142857.red/book "> 在小彭老师自己维护的镜像上浏览本书</ a > </ p >
281
281
< h2 id ="_2 "> 格式约定</ h2 >
282
282
< blockquote >
Original file line number Diff line number Diff line change @@ -389,7 +389,7 @@ <h2 id="index-_1">前言</h2>
389
389
<blockquote>
390
390
<p><img src="../img/bulb.png" height="30px" width="auto" style="margin: 0; border: none"/> 本书还在持续更新中……要追番的话,可以在 <a href="https://github.com/parallel101/cppguidebook">GitHub</a> 点一下右上角的 “Watch” 按钮,每当小彭老师提交新 commit,GitHub 会向你发送一封电子邮件,提醒你小彭老师更新了。</p>
391
391
</blockquote>
392
- <p>更新时间:2024年08月28日 23:08:04 (UTC+08:00)</p>
392
+ <p>更新时间:2024年08月30日 17:36:18 (UTC+08:00)</p>
393
393
<p><a href="https://parallel101.github.io/cppguidebook">在 GitHub Pages 浏览本书</a> | <a href="https://142857.red/book">在小彭老师自己维护的镜像上浏览本书</a></p>
394
394
<h2 id="index-_2">格式约定</h2>
395
395
<blockquote>
@@ -2343,6 +2343,7 @@ <h2 id="cpp_tricks-_9">救命!为什么我的全局函数不能作为函数对
2343
2343
<p><img src="../img/awesomeface.png" height="30px" width="auto" style="margin: 0; border: none"/> 建议修改标准库,把小彭老师这两个真正好用的宏塞到 <code><utility></code> 和 <code><functional></code> 里,作为 C++26 标准的一部分。</p>
2344
2344
</blockquote>
2345
2345
<h2 id="cpp_tricks-map-any">map + any 外挂属性</h2>
2346
+ <p>TODO</p>
2346
2347
<h2 id="cpp_tricks-shared_ptr-deleter">自定义 shared_ptr 的 deleter</h2>
2347
2348
<h2 id="cpp_tricks-check_cuda">CHECK_CUDA 类错误检测宏</h2>
2348
2349
<h2 id="cpp_tricks-_10">函数默认参数求值的位置是调用者</h2>
@@ -11213,7 +11214,7 @@ <h2 id="design_virtual-_6">跨接口的适配器</h2>
11213
11214
};
11214
11215
</code></pre>
11215
11216
<p>他们要求的用法是先判断 hasNext(),然后才能调用 getNext 读取出真正的值。小彭老师设计了一个 Poost 适配器,把 PoostInputer 翻译成我们的 Inputer:</p>
11216
- <pre><code class="language-cpp">struct PoostInputerAdapter {
11217
+ <pre><code class="language-cpp">struct PoostInputerAdapter : Inputer {
11217
11218
PoostInputer *poostIn;
11218
11219
11219
11220
PoostInputerAdapter(PoostInputer *poostIn)
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments