浅墨浓香

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

导航

上一页 1 2 3 4 5 6 ··· 38 下一页

2020年4月23日

摘要: Chapter 6: Move Semantics and enable_if<> 第6章 移动语义和enable_if<> One of the most prominent features C++11 introduced was move semantics. You can use it 阅读全文

posted @ 2020-04-23 15:52 浅墨浓香 阅读(284) 评论(0) 推荐(0) 编辑

2020年4月22日

摘要: 5.7 Template Template Parameters 5.7 模板模板参数 It can be useful to allow a template parameter itself to be a class template. Again, our stack class templ 阅读全文

posted @ 2020-04-22 20:23 浅墨浓香 阅读(872) 评论(0) 推荐(0) 编辑

摘要: 5.6 Variable Templates 5.6 变量模板 Since C++14, variables also can be parameterized by a specific type. Such a thing is called a variable template. 从C++1 阅读全文

posted @ 2020-04-22 00:46 浅墨浓香 阅读(687) 评论(0) 推荐(0) 编辑

2020年4月20日

摘要: 5.5 Member Templates 5.5 成员模板 Class members can also be templates. This is possible for both nested classes and member functions. The application and 阅读全文

posted @ 2020-04-20 07:59 浅墨浓香 阅读(293) 评论(0) 推荐(0) 编辑

2020年4月19日

摘要: 5.4 Templates for Raw Arrays and String Literals 5.4 原生数组和字符串字面量的模板 When passing raw arrays or string literals to templates, some care has to be taken 阅读全文

posted @ 2020-04-19 13:57 浅墨浓香 阅读(238) 评论(0) 推荐(0) 编辑

摘要: 5.3 Using this-> 5.3 this->的使用 For class templates with base classes that depend on template parameters, using a name x by itself is not always equiva 阅读全文

posted @ 2020-04-19 13:53 浅墨浓香 阅读(222) 评论(0) 推荐(0) 编辑

摘要: 5.2 Zero Initialization 5.2 零初始化 For fundamental types such as int, double, or pointer types, there is no default constructor that initializes them wi 阅读全文

posted @ 2020-04-19 13:51 浅墨浓香 阅读(255) 评论(0) 推荐(0) 编辑

摘要: Chapter 5:Tricky Basics 第5章 技巧性基础知识 This chapter covers some further basic aspects of templates that are relevant to the practical use of templates: a 阅读全文

posted @ 2020-04-19 13:48 浅墨浓香 阅读(307) 评论(0) 推荐(0) 编辑

2020年4月18日

摘要: 4.3 Application of Variadic Templates 4.3 可变参数模板的应用 Variadic templates play an important role when implementing generic libraries, such as the C++ sta 阅读全文

posted @ 2020-04-18 18:53 浅墨浓香 阅读(373) 评论(0) 推荐(0) 编辑

摘要: 4.2 Fold Expressions 4.2 折叠表达式 Since C++17, there is a feature to compute the result of using a binary operator over all the arguments of a parameter 阅读全文

posted @ 2020-04-18 18:04 浅墨浓香 阅读(912) 评论(0) 推荐(0) 编辑

2020年4月17日

摘要: Chapter 4:Variadic Templates 第4章 可变参数模板 Since C++11, templates can have parameters that accept a variable number of template arguments. This feature a 阅读全文

posted @ 2020-04-17 21:57 浅墨浓香 阅读(491) 评论(2) 推荐(0) 编辑

2020年4月16日

摘要: 3.4 Template Parameter Type auto 3.4 模板参数类型auto Since C++17, you can define a nontype template parameter to generically accept any type that is allowe 阅读全文

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

摘要: 3.3 Restrictions for Nontype Template Parameters 3.3 非类型模板参数的限制 Note that nontype template parameters carry some restrictions. In general, they can be 阅读全文

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

摘要: 3.2 Nontype Function Template Parameters 3.2 非类型函数模板参数 You can also define nontype parameters for function templates. For example, the following funct 阅读全文

posted @ 2020-04-16 11:28 浅墨浓香 阅读(254) 评论(0) 推荐(0) 编辑

摘要: Chapter 3: Nontype Template Parameters 第3章 非类型模板参数 For function and class templates, template parameters don’t have to be types. They can also be ordi 阅读全文

posted @ 2020-04-16 10:18 浅墨浓香 阅读(293) 评论(0) 推荐(0) 编辑

摘要: 2.11 Summary 2.11 小结 • A class template is a class that is implemented with one or more type parameters left open. 类模板是具有如下性质的类:在类的实现中,可以有一个或多个类型参数还没有 阅读全文

posted @ 2020-04-16 00:38 浅墨浓香 阅读(196) 评论(0) 推荐(0) 编辑

摘要: 2.10 Templatized Aggregates 2.10 模板化聚合类 Aggregate classes (classes/structs with no user-provided, explicit, or inherited constructors, no private or p 阅读全文

posted @ 2020-04-16 00:36 浅墨浓香 阅读(274) 评论(0) 推荐(0) 编辑

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 浅墨浓香 阅读(697) 评论(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 浅墨浓香 阅读(335) 评论(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 浅墨浓香 阅读(240) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 38 下一页