浅墨浓香

想要天亮进城,就得天黑赶路。

导航

2020年4月15日

摘要: 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 浅墨浓香 阅读(703) 评论(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 浅墨浓香 阅读(338) 评论(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 浅墨浓香 阅读(243) 评论(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 浅墨浓香 阅读(363) 评论(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 浅墨浓香 阅读(618) 评论(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 浅墨浓香 阅读(240) 评论(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 浅墨浓香 阅读(255) 评论(0) 推荐(0) 编辑

摘要: 2.2 Use of Class Template Stack 2.2 类模板Stack的使用 To use an object of a class template, until C++17 you must always specify the template arguments expli 阅读全文

posted @ 2020-04-15 22:16 浅墨浓香 阅读(295) 评论(0) 推荐(1) 编辑