File tree 5 files changed +5
-5
lines changed
5 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ <h2 id="_1">前言</h2>
292
292
< blockquote >
293
293
< 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 >
294
294
</ blockquote >
295
- < p > 更新时间:2024年09月18日 12:29:27 (UTC+08:00)</ p >
295
+ < p > 更新时间:2024年09月19日 10:55:53 (UTC+08:00)</ p >
296
296
< p > < a href ="https://parallel101.github.io/cppguidebook "> 在 GitHub Pages 浏览本书</ a > | < a href ="https://142857.red/book "> 在小彭老师自己维护的镜像上浏览本书</ a > </ p >
297
297
< h2 id ="_2 "> 格式约定</ h2 >
298
298
< blockquote >
Original file line number Diff line number Diff line change @@ -421,7 +421,7 @@ <h2 id="index-_1">前言</h2>
421
421
<blockquote>
422
422
<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>
423
423
</blockquote>
424
- <p>更新时间:2024年09月18日 12:29:27 (UTC+08:00)</p>
424
+ <p>更新时间:2024年09月19日 10:55:53 (UTC+08:00)</p>
425
425
<p><a href="https://parallel101.github.io/cppguidebook">在 GitHub Pages 浏览本书</a> | <a href="https://142857.red/book">在小彭老师自己维护的镜像上浏览本书</a></p>
426
426
<h2 id="index-_2">格式约定</h2>
427
427
<blockquote>
@@ -7904,7 +7904,7 @@ <h3 id="stl_map-typename">typename 修饰</h3>
7904
7904
typename map<int, string>::value_type; // 可以省略,但你加了也没关系
7905
7905
</code></pre>
7906
7906
<blockquote>
7907
- <p><img src="../img/question.png" height="30px" width="auto" style="margin: 0; border: none"/> 含有 T 的类型表达式称为 dependant -type,根本原因是因为在不知道具体是类型表达式还是值表达式的情况下,编译器无法区分模板的 <code><</code> 和小于符号 <code><</code>,以及类型的指针 <code>*</code> 和数值乘法 <code>*</code>。默认会认为是小于符号和数值乘法,加上 <code>typename</code> 后明确前面这一串是类型表达式,才知道这是模板的 <code><</code> 和指针的 <code>*</code>。</p>
7907
+ <p><img src="../img/question.png" height="30px" width="auto" style="margin: 0; border: none"/> 含有 T 的类型表达式称为 dependent -type,根本原因是因为在不知道具体是类型表达式还是值表达式的情况下,编译器无法区分模板的 <code><</code> 和小于符号 <code><</code>,以及类型的指针 <code>*</code> 和数值乘法 <code>*</code>。默认会认为是小于符号和数值乘法,加上 <code>typename</code> 后明确前面这一串是类型表达式,才知道这是模板的 <code><</code> 和指针的 <code>*</code>。</p>
7908
7908
</blockquote>
7909
7909
<h3 id="stl_map-decltype">decltype 大法好</h3>
7910
7910
<p>也有更直观的获取 STL 容器元素类型的方法:</p>
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -1945,7 +1945,7 @@ <h3 id="typename">typename 修饰</h3>
1945
1945
typename map<int, string>::value_type; // 可以省略,但你加了也没关系
1946
1946
</ code > </ pre >
1947
1947
< blockquote >
1948
- < p > < img src ="../img/question.png " height ="30px " width ="auto " style ="margin: 0; border: none "/> 含有 T 的类型表达式称为 dependant -type,根本原因是因为在不知道具体是类型表达式还是值表达式的情况下,编译器无法区分模板的 < code > <</ code > 和小于符号 < code > <</ code > ,以及类型的指针 < code > *</ code > 和数值乘法 < code > *</ code > 。默认会认为是小于符号和数值乘法,加上 < code > typename</ code > 后明确前面这一串是类型表达式,才知道这是模板的 < code > <</ code > 和指针的 < code > *</ code > 。</ p >
1948
+ < p > < img src ="../img/question.png " height ="30px " width ="auto " style ="margin: 0; border: none "/> 含有 T 的类型表达式称为 dependent -type,根本原因是因为在不知道具体是类型表达式还是值表达式的情况下,编译器无法区分模板的 < code > <</ code > 和小于符号 < code > <</ code > ,以及类型的指针 < code > *</ code > 和数值乘法 < code > *</ code > 。默认会认为是小于符号和数值乘法,加上 < code > typename</ code > 后明确前面这一串是类型表达式,才知道这是模板的 < code > <</ code > 和指针的 < code > *</ code > 。</ p >
1949
1949
</ blockquote >
1950
1950
< h3 id ="decltype "> decltype 大法好</ h3 >
1951
1951
< p > 也有更直观的获取 STL 容器元素类型的方法:</ p >
You can’t perform that action at this time.
0 commit comments