C++ Language Standards Supported by GCC ( GCC 支持的C++语言标准 )

8 篇文章 0 订阅

Using the GNU Compiler Collection

Language Standards Supported by GCC

2.2 C++ Language

GCC supports the original ISO C++ standard published in 1998, and the 2011 and 2014 revisions.

GCC支持1998年出版的原始 ISO C ++标准,以及2011年2014年版本。

The original ISO C++ standard was published as the ISO standard (ISO/IEC 14882:1998)
and amended by a Technical Corrigenda published in 2003 (ISO/IEC 14882:2003).

原始 ISO C++ 标准作为ISO标准 (ISO/IEC 14882:1998) 发布并经2003年出版的技术勘误表 (ISO/IEC 14882:2003) 修订。

These standards are referred to as C++98 and C++03, respectively.

这些标准分别被称为 C++98C++03

GCC implements the majority of C++98 (export is a notable exception) and most of the changes in C++03.

GCC实现了大部分 C++98(比如导出就是一明显的例外),和 C++03 中的大部分更改。

To select this standard in GCC, use one of the options ‘-ansi’, ‘-std=c++98’, or ‘-std=c++03’;

要在GCC中选择此标准,请使用'-ansi''-std=c++98''-std=c++03'选项中的一个;

to obtain all the diagnostics required by the standard, you should also specify ‘-pedantic’ (or
‘-pedantic-errors’ if you want them to be errors rather than warnings).

要获得该标准所需的所有诊断信息,还应指定'-pedantic' (或 '-pedantic-errors' 如果你希望他们是错误,而不是警告)

A revised ISO C++ standard was published in 2011 as ISO/IEC 14882:2011, and is referred to as C++11;

2011年修订后的ISO C++标准于以ISO/IEC 14882:2011出版,被称为 C++11;

before its publication it was commonly referred to as C++0x. C++11 contains several changes to the C++ language, all of which have been implemented in GCC.
For details see https://gcc.gnu.org/projects/cxx0x.html.

在发布之前通常被称为C++0x。C++11包含对C ++语言的几个更改都已在GCC中实现。
更多细节详见 https://gcc.gnu.org/projects/cxx0x.html.

To select this standard in GCC, use the option‘-std=c++11’.

要在GCC中选择此标准,请使用选项'-std=c++11'

Another revised ISO C++ standard was published in 2014 as ISO/IEC 14882:2014, and is referred to as C++14;

另一个修订的ISO C++标准于2014年ISO/IEC 14882:2014 出版,被称为 C++14;

before its publication it was sometimes referred to as C++1y.

在发布之前有时被称为 C++1y。

C++14 contains several further changes to the C++ language, all of which have been implemented in GCC.
For details see https://gcc.gnu.org/projects/cxx1y.html.

C++14 包含对C++语言几个特性的修改,所有这些都已在GCC中实现。
更多细节详见 https://gcc.gnu.org/projects/cxx1y.html.

To select this standard in GCC, use the option ‘-std=c++14’.

要在GCC中选择此标准,请使用选项'-std=c++14'

GCC also supports the C++ Concepts Technical Specifcation, ISO/IEC TS 19217:2015,
which allows constraints to be defined for templates, allowing template arguments to be
checked and for templates to be overloaded or specialized based on the constraints.

GCC还支持 C++ 概念技术 ISO/IEC TS 19217:2015 规范,
这允许为模板定义约束, 允许使用模板参数检查和模板被重载或基于特定的约束。

Support for C++ Concepts is included in an experimental C++1z mode that corresponds to the next
revision of the ISO C++ standard, expected to be published in 2017.

GCC还支持在实验C++1z模式中的C++概念,对应于下一个版本的 ISO C++标准,预计将于2017年发布。

To enable C++1z support in GCC, use the option ‘-std=c++17’ or ‘-std=c++1z’.

要在GCC中启用对C++1z模式的支持,请使用选项'-std=c++17''-std=c ++ 1z'

More information about the C++ standards is available on the ISO C++ committee’s web site at http://www.open-std.org/jtc1/sc22/wg21/.

有关C ++标准的更多信息可以在ISO C++委员会网站中找到 http://www.open-std.org/jtc1/sc22/wg21/

To obtain all the diagnostics required by any of the standard versions described above you should specify ‘-pedantic’ or ‘-pedantic-errors’, otherwise GCC will allow some non-ISO C++ features as extensions.
See Section 3.8 [Warning Options], page 59.

获得上述任何标准版本所需的所有诊断信息你应该指定 '-pedantic''-pedantic-errors'
否则GCC将允许一些非ISO C++标准的功能作为扩展
详见 3.8 节 [警告选项], 59页

By default, GCC also provides some additional extensions to the C++ language that on rare occasions conflict with the C++ standard.
See Section 3.5 [C++ Dialect Options],page 40.

默认情况下,GCC还为C ++语言提供了一些额外的扩展在极少的情况下与 C++标准相冲突。
详见 3.5 节 [C++ 方言选项], 40 页

Use of the ‘-std’ options listed above disables these extensions where they they conflict with the C++ standard version selected.

使用上面列出的'-std'选项可以禁用这些扩展特性,使GCC与所选择的C++标准的版本一致。

You may also select an extended version of the C++ language explicitly with
‘-std=gnu++98’ (for C++98 with GNU extensions), or
‘-std=gnu++11’ (for C++11 with GNU extensions), or
‘-std=gnu++14’ (for C++14 with GNU extensions), or
‘-std=gnu++1z’ (for C++1z with GNU extensions).

您也可以使用下列选项明确地选择C ++语言的扩展版本
'-std=gnu++98' (for C++98 with GNU extensions)
'-std=gnu++11' (for C++11 with GNU extensions), or
'-std=gnu++14' (for C++14 with GNU extensions), or
'-std=gnu++1z' (for C++1z with GNU extensions).

The default, if no C++ language dialect options are given, is ‘-std=gnu++14’.

默认情况下,如果没有给出 C++ 语言方言选项,则为'-std=gnu++14'

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
该资源不适合C、C++初学者,可作为C++高手向大师级进化的参考书。 内容: ... 17 Library introduction 17.1 General 17.2 The C standard library 17.3 Definitions 17.4 Additional definitions 17.5 Method of description (Informative) 17.6 Library-wide requirements 18 Language support library 18.1 General 18.2 Types 18.3 Implementation properties 18.4 Integer types 18.5 Start and termination 18.6 Dynamic memory management CONTENTS v c ISO/IEC N3000=09-0190 18.7 Type identification 18.8 Exception handling 18.9 Initializer lists 18.10Other runtime support 19 Diagnostics library 456 19.1 General 19.2 Exception classes 19.3 Assertions 19.4 Error numbers 19.5 System error support 20 General utilities library 20.1 General 20.2 Requirements 20.3 Utility components 20.4 Compile-time rational arithmetic 20.5 Tuples 20.6 Metaprogramming and type traits 20.7 Function objects . 520 20.8 Memory 541 20.9 Time utilities 583 20.10Date and time functions 596 20.11Class type_index 596 21 Strings library 599 21.1 General 599 21.2 Character traits 599 21.3 String classes 605 21.4 Class template basic_string 608 21.5 Numeric Conversions 635 21.6 Null-terminated sequence utilities . 636 22 Localization library 640 22.1 General 640 22.2 Header <locale> synopsis 640 22.3 Locales 641 22.4 Standard locale categories . 653 22.5 Standard code conversion facets 693 22.6 C Library Locales 695 23 Containers library 696 23.1 General 696 23.2 Container requirements 696 23.3 Sequence containers 719 23.4 Associative containers . 758 23.5 Unordered associative containers . 776 24 Iterators library 791 24.1 General 791 24.2 Iterator requirements 791 CONTENTS vi c ISO/IEC N3000=09-0190 24.3 Header <iterator> synopsis 796 24.4 Iterator primitives 799 24.5 Iterator adaptors . 802 24.6 Stream iterators . 816 25 Algorithms library 825 25.1 General 825 25.2 Non-modifying sequence operations 835 25.3 Mutating sequence operations 839 25.4 Sorting and related operations 848 25.5 C library algorithms 862 26 Numerics library 864 26.1 General 864 26.2 Numeric type requirements . 864 26.3 The floating-point environment 865 26.4 Complex numbers 866 26.5 Random number generation . 876 26.6 Numeric arrays 920 26.7 Generalized numeric operations 940 26.8 C Library 944 27 Input/output library 949 27.1 General 949 27.2 Iostreams requirements . 950 27.3 Forward declarations 950 27.4 Standard iostream objects 952 27.5 Iostreams base classes . 954 27.6 Stream buffers 972 27.7 Formatting and manipulators 982 27.8 String-based streams 1009 27.9 File-based streams 1021 28 Regular expressions library 1036 28.1 General 1036 28.2 Definitions 1036 28.3 Requirements 1037 28.4 Header <regex> synopsis 1039 28.5 Namespace std::regex_constants 1045 28.6 Class regex_error 1048 28.7 Class template regex_traits 1048 28.8 Class template basic_regex 1051 28.9 Class template sub_match 1056 28.10Class template match_results 1062 28.11Regular expression algorithms 1066 28.12Regular expression Iterators . 1070 28.13Modified ECMAScript regular expression grammar 1076 29 Atomic operations library 1079 29.1 General 1079 29.2 Header <atomic> synopsis 1079 CONTENTS vii c ISO/IEC N3000=09-0190 29.3 Order and Consistency . 1082 29.4 Lock-free Property 1084 29.5 Atomic Types 1085 29.6 Operations on Atomic Types 1094 29.7 Flag Type and Operations 1098 29.8 Fences . 1099 30 Thread support library 1101 30.1 General 1101 30.2 Requirements 1101 30.3 Threads 1102 30.4 Mutual exclusion . 1107 30.5 Condition variables 1121 30.6 Futures 1129 A Grammar summary 1149 A.1 Keywords 1149 A.2 Lexical conventions 1149 A.3 Basic concepts 1154 A.4 Expressions . 1154 A.5 Statements . 1158 A.6 Declarations . 1159 A.7 Declarators . 1162 A.8 Classes . 1164 A.9 Derived classes 1165 A.10 Special member functions 1165 A.11 Overloading . 1165 A.12 Templates 1166 A.13 Exception handling 1167 A.14 Preprocessing directives 1167 B Implementation quantities 1169 C Compatibility 1171 C.1 C++ and ISO C 1171 C.2 Standard C library 1181 D Compatibility features 1185 D.1 Increment operator with bool operand . 1185 D.2 static keyword . 1185 D.3 Access declarations 1185 D.4 Implicit conversion from const strings . 1185 D.5 register keyword 1185 D.6 C standard library headers . 1185 D.7 Old iostreams members 1186 D.8 char* streams 1187 D.9 Binders 1196 D.10 auto_ptr 1198 E Cross references 1201 Index 1218 CONTENTS viii ISO/IEC N3000=09-0190 Index of Grammar Productions 1243 Index of Library Names 1246 Index of Implementation Defined Behavior 1280

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值