ImageVerifierCode 换一换
格式:PDF , 页数:60 ,大小:2MB ,
资源ID:1257458      下载积分:10000 积分
快捷下载
登录下载
邮箱/手机:
温馨提示:
如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝扫码支付 微信扫码支付   
注意:如需开发票,请勿充值!
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【http://www.mydoc123.com/d-1257458.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(ISO IEC TS 19217-2015 Information technology - Programming languages - C++ Extensions for concepts《信息技术 编程语言 C++概念的扩展》.pdf)为本站会员(confusegate185)主动上传,麦多课文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文库(发送邮件至master@mydoc123.com或直接QQ联系客服),我们立即给予删除!

ISO IEC TS 19217-2015 Information technology - Programming languages - C++ Extensions for concepts《信息技术 编程语言 C++概念的扩展》.pdf

1、Information technology Programming languages C+ Extensions for concepts Technologie de linformation Langages de programmation Extensions C+ pour les concepts warning ISO/IEC TS 19217 First edition 2015-11-1 5 Reference number ISO/IEC TS 19217:2015(E) TECHNICAL SPECIFICATION ISO/IEC 2015 ii ISO/IEC 2

2、015 All rights reserved COPYRIGHT PROTECTED DOCUMENT ISO/IEC 2015, Published in Switzerland All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting o

3、n the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below or ISOs member body in the country of the requester. ISO copyright office Ch. de Blandonnet 8 CP 401 CH-1214 Vernier, Geneva, Switzerland Tel. +41 22 749 01 11 Fax +41 22

4、 749 09 47 copyrightiso.org www.iso.org ISO/IEC TS 19217:2015(E)c ISO/IEC N4549 Contents iii ivv Contents List of Tables Foreword 1 General 1 1.1 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Normative references . . . . . . . . . . . . . .

5、 . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.3 Terms and denitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.4 Implementation compliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.5 Feature-testing recommendations . . .

6、 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.6 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2 Lexical conventions 3 2.1 Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 5 Expr

7、essions 4 5.1 Primary expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 7 Declarations 11 7.1 Speciers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 8 Declarators 21 8.3 Meaning of declarators . . . . . . . . .

8、 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 10 Derived classes 25 10.3 Virtual functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 13 Overloading 26 13.1 Overloadable declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9、 . . . . . 26 13.3 Overload resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 13.4 Address of overloaded function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 14 Templates 28 14.1 Template parameters . . . . . . . . . . . . . . . .

10、 . . . . . . . . . . . . . . . . . . . . . . . 28 14.2 Introduction of template parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 14.3 Names of template specializations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 14.4 Template arguments . . . . . . . .

11、 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 14.6 Template declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 14.7 Name resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 14.8 Template instant

12、iation and specialization . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 14.9 Function template specializations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 14.10 Template constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 A C

13、ompatibility 53 A.1 C + extensions for Concepts and ISO C + 2014 . . . . . . . . . . . . . . . . . . . . . . . 53 Contents iii ISO/IEC 2015 All rights reserved ISO/IEC TS 19217:2015 (E)c ISO/IEC N4549 List of Tables A Feature-test macro(s) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

14、 . . . . . . . . . . 2 10 simple-type-speciers and the types they specify . . . . . . . . . . . . . . . . . . . . . . . . . . 12 B Value of folding empty sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 List of Tables iv ISO/IEC TS 19217:2015 (E) ISO/IEC 2015 All r

15、ights reserved ISO/IEC N4549 ISO/IEC 2015 All rights reserved Foreword ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for worldwide standardization. National bodies that are members of ISO or IEC participat

16、e in the development of International Standards through technical committees established by the respective organization to deal with particular fields of technical activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other international organizations, governmental and

17、 non-governmental, in liaison with ISO and IEC, also take part in the work. In the field of information technology, ISO and IEC have established a joint technical committee, ISO/IEC JTC 1. The procedures used to develop this document and those intended for its further maintenance are described in th

18、e ISO/IEC Directives, Part 1. In particular the different approval criteria needed for the different types of document should be noted. This document was drafted in accordance with the editorial rules of the ISO/IEC Directives, Part 2 (see www.iso.org/directives). Attention is drawn to the possibili

19、ty that some of the elements of this document may be the subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights. Details of any patent rights identified during the development of the document will be in the Introduction and/or on the ISO lis

20、t of patent declarations received (see www.iso.org/patents). Any trade name used in this document is information given for the convenience of users and does not constitute an endorsement. For an explanation on the meaning of ISO specific terms and expressions related to conformity assessment, as wel

21、l as information about ISOs adherence to the WTO principles in the Technical Barriers to Trade (TBT) see the following URL: Foreword - Supplementary information The committee responsible for this document is ISO/IEC JTC 1, Information technology, SC 22, Programming languages, their environments and

22、system software interfaces. ISO/IEC TS 19217:2015 (E)c ISO/IEC N4549 1 General intro 1.1 Scope intro.scope 1 This Technical Specication describes extensions to the C + Programming Language (1.2) that enable the specication and checking of constraints on template arguments, and the ability to overloa

23、d functions and specialize class templates based on those constraints. These extensions include new syntactic forms and modications to existing language semantics. 2 The International Standard, ISO/IEC 14882, provides important context and specication for this Technical Specication. This document is

24、 written as a set of changes against that specication. Instructions to modify or add paragraphs are written as explicit instructions. Modications made directly to existing text from the International Standard use underlining to represent added text and strikethrough to represent deleted text. 3 WG21

25、 paper N4191 denes “fold expressions”, which are used to dene constraint expressions resulting from the use of constrained-parameters that declare template parameter packs. This feature is not present in ISO/IEC 14882:2014, but it is planned to be included in the next revision of that International

26、Standard. The specication of that feature is included in this document. 1.2 Normative references intro.refs 1 The following referenced document is indispensable for the application of this document. For dated refer- ences, only the edition cited applies. For undated references, the latest edition of

27、 the referenced document (including any amendments) applies. (1.1) ISO/IEC 14882:2014, Programming Languages C + ISO/IEC 14882:2014 is hereafter called the C + Standard. The numbering of Clauses, sections, and para- graphs in this document reects the numbering in the C + Standard. References to Clau

28、ses and sections not appearing in this Technical Specication refer to the original, unmodied text in the C + Standard. 1.3 Terms and denitions intro.defs Modify the denitions of “signature” to include associated constraints (14.10.2). This allows dierent trans- lation units to contain denitions of f

29、unctions with the same signature, excluding associated constraints, without violating the one denition rule (3.2). That is, without incorporating the constraints in the signa- ture, such functions would have the same mangled name, thus appearing as multiple denitions of the same function. 1.3.1 defn

30、s.signature signature name,parametertypelist(8.3.5), andenclosingnamespace(ifany),andanyassociated constraints (14.10.2) Note: Signatures are used as a basis for name mangling and linking.end note 1.3.2 defns.signature.templ signaturename, parameter type list (8.3.5), enclosing namespace (if any), r

31、eturn type, and template parameter list, and any associated constraints (14.10.2) 1.3.3 defns.signature.member 1.3 1 ISO/IEC 2015 All rights reserved ISO/IEC TS 19217:2015 (E)c ISO/IEC N4549 signaturename, parameter type list (8.3.5), class of which the function is a member, cv-qualiers (if any), an

32、d ref-qualier (if any), and any associated constraints (14.10.2) 1.3.4 defns.signature.member.templ signaturename, parameter type list (8.3.5), class of which the function is a member, cv-qualiers (if any), ref-qualier (if any), return type, and template parameter list, and any associated constraint

33、s (14.10.2) 1.4 Implementation compliance pliance 1 Conformance requirements for this specication are the same as those dened in 1.4 in the C + Standard. Note: Conformance is dened in terms of the behavior of programs. end note 1.5 Feature-testing recommendations intro.features 1 An implementation t

34、hat provides support for this Technical Specication shall dene the feature test macro(s) in Table A. Table A Feature-test macro(s) Macro name Value _cpp_concepts 201507 1.6 Acknowledgments intro.ack 1 The design of this specication is based, in part, on a concept specication of the algorithms part o

35、f the C+ standard library, known as “The Palo Alto” report (WG21 N3351), which was developed by a large group of experts as a test of the expressive power of the idea of concepts. Despite syntactic dierences between the notation of the Palo Alto report and this Technical Specication, the report can

36、be seen as a large-scale test of the expressiveness of this Technical Specication. 2 This work was funded by NSF grant ACI-1148461. 1.6 2 ISO/IEC TS 19217:2015 (E) ISO/IEC 2015 All rights reserved c ISO/IEC N4549 2 Lexical conventions lex 2.1 Keywords lex.key In 2.1, add the keywords concept and req

37、uires to Table 4. 2.1 3 ISO/IEC 2015 All rights reserved ISO/IEC TS 19217:2015 (E)c ISO/IEC N4549 5 Expressions expr Modify paragraph 8 to include a reference to requires-expressions. 1 In some contexts, unevaluated operands appear (5.1.4, 5.2.8, 5.3.3, 5.3.7). 5.1 Primary expressions expr.prim 5.1.

38、1 General expr.prim.general In this section, add the requires-expression to the rule for primary-expression. primary-expression: literal this ( expression ) id-expression lambda-expression fold-expression requires-expression In paragraph 8, add auto and constrained-type-name to nested-name-specier:

39、8 nested-name-specier: : type-name : namespace-name : decltype-specier : auto : constrained-type-name : nested-name-specier identier : nested-name-specier templateopt: Add a new paragraph after paragraph 11: 12 In a nested-name-specier of the form auto: or C:, where C is a constrained-type-name, tha

40、t nested-name-specier designates a placeholder that will be replaced later according to the rules for placeholder deduction in 7.1.6.4. If a placeholder designated by a constrained-type-specier is not a placeholder type, the program is ill-formed. Note: A constrained-type-specier can designate a pla

41、ceholder for a non-type or template (7.1.6.4.2). end note The replacement type deduced for a placeholder shall be a class or enumeration type. Example: template concept bool C = sizeof(T) = sizeof(int); template concept bool D = true; struct S1 int n; ; struct S2 char c; ; struct S3 struct X using Y

42、 = int; ; ; int auto:* p1 = / auto deduced as S1 int D:* p2 = / error: D does not designate a placeholder type int C:* p3 = / OK: C deduced as S1 char C:* p4 = / error: deduction fails because constraints are not satised 5.1.1 4 ISO/IEC TS 19217:2015 (E) ISO/IEC 2015 All rights reserved c ISO/IEC N4

43、549 void f(typename auto:X:Y); f(S1(); / error: auto cannot be deduced from S1() f(0); / OK In the declaration of f, the placeholder appears in a non-deduced context (14.8.2.5). It may be replaced later through the explicit specication of template arguments. end example Add a new paragraph after par

44、agraph 13: 14 A program that refers explicitly or implicitly to a function with associated constraints that are not satised (14.10.2), other than to declare it, is ill-formed. Example: void f(int) requires false; f(0); / error: cannot call f void (*p1)(int) = f; / error: cannot take the address of f

45、 decltype(f)* p2 = nullptr; / error: the type decltype(f) is invalid In each case the associated constraints of f are not satised. In the declaration of p2, those constraints are required to be satised even though f is an unevaluated operand (Clause 5). end example 5.1.2 Lambda expressions expr.prim

46、lambda Insert the following paragraph after paragraph 4 to dene the term “generic lambda”. 5 A generic lambda is a lambda-expression where one or more placeholders (7.1.6.4) appear in the parameter-type-list of the lambda-declarator. Modify paragraph 5 so that the meaning of a generic lambda is den

47、ed in terms of its abbreviated member function template call operator. The closure type for a non-generic lambda-expression has a public inline function call operator (13.5.4) whose parameters and return type are described by the lambda-expressions parameter- declaration-clause and trailing-return-t

48、ype, respectively. For a generic lambda, the closure type hasapublic inline function calloperatormembertemplate (14.5.2)whosetemplate-parameter-list consists of one invented type template-parameter for each occurrence of auto in the lambdas parameter-declaration-clause, in order of appearance. The invented type template-parameter is a parameter pack if the corresponding parameter-declaration declares a function parameter pack (8.3.5). The return type and function parameters of the function call operator template are derived from the

copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1