posted @ 2020-04-15 22:49 浅墨浓香 阅读(711) 评论(0) 推荐(1) 编辑
摘要:
2.9 Class Template Argument Deduction 2.9 类模板参数推导 Until C++17, you always had to pass all template parameter types to class templates(unless they have 阅读全文
|
||
摘要:
2.9 Class Template Argument Deduction 2.9 类模板参数推导 Until C++17, you always had to pass all template parameter types to class templates(unless they have 阅读全文
posted @ 2020-04-15 22:49 浅墨浓香 阅读(711) 评论(0) 推荐(1) 编辑
摘要:
2.8 Type Aliases 2.8 类型别名 You can make using a class template more convenient by defining a new name for the whole type. 通过为整个类型定义一个新的名字,可以让类模板的使用更加方便 阅读全文
posted @ 2020-04-15 22:41 浅墨浓香 阅读(343) 评论(0) 推荐(0) 编辑
摘要:
2.7 Default Class Template Arguments 2.7 默认类模板实参 As for function templates, you can define default values for class template parameters. For example, 阅读全文
posted @ 2020-04-15 22:36 浅墨浓香 阅读(244) 评论(0) 推荐(0) 编辑
摘要:
2.6 Partial Specialization 2.6 偏特化 Class templates can be partially specialized. You can provide special implementations for particular circumstances, 阅读全文
posted @ 2020-04-15 22:32 浅墨浓香 阅读(367) 评论(0) 推荐(0) 编辑
摘要:
2.5 Specializations of Class Templates 2.5 类模板的特化 You can specialize a class template for certain template arguments. Similar to the overloading of fu 阅读全文
posted @ 2020-04-15 22:26 浅墨浓香 阅读(623) 评论(0) 推荐(0) 编辑
摘要:
2.4 Friends 2.4 友元 Instead of printing the stack contents with printOn() it is better to implement toperator<< for the stack. However, as usual operat 阅读全文
posted @ 2020-04-15 22:23 浅墨浓香 阅读(243) 评论(0) 推荐(0) 编辑
摘要:
2.3 Partial Usage of Class Templates 2.3 类模板的局部使用 A class template usually applies multiple operations on the template arguments it is instantiated fo 阅读全文
posted @ 2020-04-15 22:19 浅墨浓香 阅读(257) 评论(0) 推荐(0) 编辑 |
||