作者Dannvix (Dan)
看板C_and_CPP
标题[分享] C++ Templates & Generic Programming
时间Mon Nov 9 21:56:13 2015
本鲁近日参加 "Effective C++ 3/e" 读书会
负责第七章 "Templates & Generic Programming"
和大家分享投影片,请不吝指教 <(_ _)>
https://speakerdeck.com/dannvix/c-plus-plus-templates-and-generic-programming
内容包含:
- Item 41: Understand implicit interfaces and compile-time polymorphism
- Item 42: Understand the two meanings of `typename`
- Item 43: Know how to access names in templatized base classes
- Item 44: Factor parameter-independent code out of templates
- Item 45: Use member function templates to accept "all compatible types"
- Item 46: Define non-member function inside templates
when type conversion are desired
- Item 47: Use traits classes for information about types
- Item 48: Be aware of template metaprogramming
// 内容较多故字体偏小,建议下载 PDF 以方便阅读 :P
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 111.240.178.38
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/C_and_CPP/M.1447077381.A.DC1.html
1F:推 gn0111: <(_ _)> 11/09 23:14
2F:推 descent: 看英文版的哦,好猛 11/10 00:10
3F:→ erotic: Thanks for sharing, 有其他章节的投影片吗? 11/10 16:08
4F:推 yea107: 感谢!!想要看其他章节+1 11/10 16:42
5F:→ Dannvix: 其它章节是别人做的,就无法分享罗 :P 11/10 20:05
6F:推 Sirctal: 我还满想了解 item 23的XD 11/11 09:25
7F:推 stupid0319: 程式写的好,要饭要到老 11/11 09:57
9F:→ dreamboat66: b呢? 11/13 00:36
10F:→ dreamboat66: appendix好像有写说他要找最特化的? 那应该找b不是? 11/13 00:37
11F:→ dreamboat66: 还有最後一页的 最後一点 The primaray template.... 11/13 00:38
12F:→ dreamboat66: only那部份英文不太理解, 是说以有特化以特化为优先? 11/13 00:39
13F:推 damody: 11/13 15:23
14F:→ firose: 因为它把 b 当作是 a 的 specialization 11/13 22:47
15F:→ firose: and c is more specialized than a 11/13 22:53
16F:推 dreamboat66: b不是全特化吗?怎会输c 11/15 10:31
17F:→ firose: 但它们都是 template 要先依 partial ordering 比较 a & c 11/15 12:53
18F:→ firose: 若 a 胜 c 结果就会选 b, 但是现在 c 比 a 特殊. 11/15 12:54