资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

C++使用标准概念有什么优点

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

公司主营业务:网站建设、成都做网站、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。创新互联建站是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。创新互联建站推出梅州免费做网站回馈大家。

T.11:只要可能就使用标准概念

Reason(原因)

"Standard" concepts (as provided by the GSL and the Ranges TS, and hopefully soon the ISO standard itself) save us the work of thinking up our own concepts, are better thought out than we can manage to do in a hurry, and improve interoperability.

“标准”的概念(由GSL或Range技术规格提供,很有可能很快ISO标准也会提供)可以节约我们设计自用概念的工作,而且标准概念会比我们匆忙之间设计的概念更好,也更具互换性。

Note(注意)

Unless you are creating a new generic library, most of the concepts you need will already be defined by the standard library

除非你在开发新的通用库,大部分你需要的概念应该已经在标准库中有定义而不需要另外设计。

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

template
   // don't define this: Sortable is in the GSL
concept Ordered_container = Sequence && Random_access> && Ordered>;

void sort(Ordered_container& s);

This Ordered_container is quite plausible, but it is very similar to the Sortable concept in the GSL (and the Range TS). Is it better? Is it right? Does it accurately reflect the standard's requirements for sort? It is better and simpler just to use Sortable:

Ordered_container相当合理,但是它和GSL(和RangeTS)中的Sortable概念非常相似。这么做更好么?这么做正确么?它准确地反映了排序的标准需求么?直接使用Sortable的方式更简单也更好。

void sort(Sortable& s);   // better
Note(注意)

The set of "standard" concepts is evolving as we approach an ISO standard including concepts.

在我们努力将概念引入ISO标准的过程中,这一套“标准”概念也在逐步发展。

Note(注意)

Designing a useful concept is challenging.

设计一个有用的概念是一种挑战。

Enforcement(实施建议)

Hard.

很难

  • Look for unconstrained arguments, templates that use "unusual"/non-standard concepts, templates that use "homebrew" concepts without axioms.

  • 寻找使用没有约束的参数,使用“不一般的”/非标准概念的模板,使用没有经过严密论证的自己定义的概念的模板。

  • Develop a concept-discovery tool (e.g., see an early experiment).

  • 设计一个发现概念的工具

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


名称栏目:C++使用标准概念有什么优点
分享URL:http://cdkjz.cn/article/jodceo.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220