网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

C++单类型参数概念是什么

本篇内容主要讲解“C++单类型参数概念是什么”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“C++单类型参数概念是什么”吧!

成都创新互联公司专业为企业提供葫芦岛网站建设、葫芦岛做网站、葫芦岛网站设计、葫芦岛网站制作等企业网站建设、网页设计与制作、葫芦岛企业网站模板建站服务,十年葫芦岛做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。

T.13:对于简单的,单类型参数概念,使用缩略记法更好

Reason(原因)

Readability. Direct expression of an idea.

可读性。直接表现想法。

Example (using TS concepts)示例(使用TS概念)

To say "T is Sortable":

为了表达“T是可排序类型”:

template       // Correct but verbose: "The parameter is
//    requires Sortable   // of type T which is the name of a type
void sort(T&);             // that is Sortable"

template       // Better (assuming support for concepts): "The parameter is of type T
void sort(T&);             // which is Sortable"

void sort(Sortable&);      // Best (assuming support for concepts): "The parameter is Sortable"

The shorter versions better match the way we speak. Note that many templates don't need to use the template keyword.

较短的版本更符合我们想要表达的。注意很多模板不需要使用模板关键字。

Note(注意)

"Concepts" are defined in an ISO Technical Specification: concepts. A draft of a set of standard-library concepts can be found in another ISO TS: ranges Concepts are supported in GCC 6.1 and later. Consequently, we comment out uses of concepts in examples; that is, we use them as formalized comments only. If you use a compiler that supports concepts (e.g., GCC 6.1 or later), you can remove the //

“概念”在ISO技术规格concepts中被定义。一套标准库concepts的初步版本可以在另一个ISO技术规格:ranges中找到。GCC6.1以后都支持concepts。因此我们在实例代码中注释掉使用concepts的部分;也就是说我们只是将它们用作标准的注释。如果你使用GCC6.1之后的版本,可以打开注释。

Enforcement(实施建议)

  • Not feasible in the short term when people convert from the  and  notation.

  • 如果人们从记法转过来,使用缩略记法是不合适的。

  • Later, flag declarations that first introduce a typename and then constrain it with a simple, single-type-argument concept.

  • 随后,标记第一次引入类型名并马上使用简单的,单类型概念对其进行约束的情况。

到此,相信大家对“C++单类型参数概念是什么”有了更深的了解,不妨来实际操作一番吧!这里是创新互联网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!


标题名称:C++单类型参数概念是什么
网页网址:http://bjjierui.cn/article/gsihjd.html

其他资讯