没有合适的资源?快使用搜索试试~ 我知道了~
首页C++国际标准ISO/IEC 14882:2003详解:C++编程语言权威指南
C++国际标准ISO/IEC 14882:2003详解:C++编程语言权威指南
5星 · 超过95%的资源 需积分: 50 16 下载量 137 浏览量
更新于2024-07-29
1
收藏 2.33MB PDF 举报
"ISO/IEC 14882:2003 是 C++ 的国际标准文档,正式发布于 2003 年 10 月 15 日,它作为编程语言标准,第二版规定了 C++ 语言的基础特性和行为规范。这份标准由 INCITS(美国信息技术标准委员会)采纳,并被美国国家标准协会 ANSI 接受,其 ANSI 批准日期为 2003 年 12 月 29 日。标准的出版方是 American National Standards Institute(美国国家标准协会),地址位于纽约市。
C++ 语言标准旨在提供一致性、可移植性和可扩展性,确保所有符合该标准的编译器之间都能产生兼容的代码。ISO/IEC 14882:2003 包含了诸如类与对象、模板、异常处理、命名空间、STL(标准模板库)等核心概念的详细说明,这些都是现代 C++ 开发的基础。此外,它还定义了语言的语法规则、类型系统以及程序执行的规则,如构造函数、析构函数和赋值运算符的行为。
版权方面,标准材料受到 International Standardization Organization (ISO)、International Electrotechnical Commission (IEC)、American National Standards Institute (ANSI) 和 Information Technology Industry Council (ITI) 的共同保护,未经许可,禁止任何形式的复制,包括电子检索。所有关于该标准的请求应直接提交给 ITI,地址位于华盛顿特区。
值得注意的是,该文档附带的 PDF 版本可能包含免责声明,这意味着在使用或传播该标准时,必须遵循特定的使用条款和条件。对于那些在 C++ 编程领域遇到疑问或者需要深入理解语言规范的开发者来说,ISO/IEC 14882:2003 是不可或缺的参考资源,它为开发者提供了官方认可的语言指南,确保了代码的正确性和一致性,是编写高质量 C++ 代码的基础。"
ISO/IEC 14882:2003(E)
xvi © ISO/IEC 2003 — All rights reserved
21.3.5.8 basic_string::swap ..........................................................................................................403
21.3.6 basic_string string operations ................................................................................................403
21.3.6.1 basic_string::find ..........................................................................................................403
21.3.6.2 basic_string::rfind........................................................................................................404
21.3.6.3 basic_string::find_first_of.....................................................................................404
21.3.6.4 basic_string::find_last_of.......................................................................................405
21.3.6.5 basic_string::find_first_not_of...........................................................................405
21.3.6.6 basic_string::find_last_not_of .............................................................................406
21.3.6.7 basic_string::substr .....................................................................................................406
21.3.6.8 basic_string::compare...................................................................................................406
21.3.7 basic_string non-member functions ......................................................................................407
21.3.7.1 operator+................................................................................................................................407
21.3.7.2 operator== .............................................................................................................................408
21.3.7.3 operator!= .............................................................................................................................408
21.3.7.4 operator<................................................................................................................................409
21.3.7.5 operator>................................................................................................................................409
21.3.7.6 operator<= .............................................................................................................................409
21.3.7.7 operator>= .............................................................................................................................410
21.3.7.8 swap............................................................................................................................................410
21.3.7.9 Inserters and extractors ................................................................................................................410
21.4 Null-terminated sequence utilities .....................................................................................................411
22 Localization library ...............................................................................................................................415
22.1 Locales ...............................................................................................................................................415
22.1.1 Class locale ................................................................................................................................416
22.1.1.1 locale types .............................................................................................................................418
22.1.1.1.1 Type locale::category...................................................................................................418
22.1.1.1.2 Class locale::facet .........................................................................................................420
22.1.1.1.3 Class locale::id.................................................................................................................420
22.1.1.2 locale constructors and destructor ...........................................................................................421
22.1.1.3 locale members .......................................................................................................................422
22.1.1.4 locale operators .......................................................................................................................422
22.1.1.5 locale static members ..............................................................................................................423
22.1.2 locale globals .............................................................................................................................423
22.1.3 Convenience interfaces ...................................................................................................................423
22.1.3.1 Character classification ................................................................................................................423
22.1.3.2 Character conversions ..................................................................................................................424
22.2 Standard locale categories.............................................................................................................424
22.2.1 The ctype category ......................................................................................................................424
22.2.1.1 Class template ctype.................................................................................................................424
22.2.1.1.1 ctype members .......................................................................................................................425
22.2.1.1.2 ctype virtual functions ...........................................................................................................426
22.2.1.2 Class template ctype_byname................................................................................................427
22.2.1.3 ctype specializations .................................................................................................................428
22.2.1.3.1 ctype<char> destructor .......................................................................................................429
22.2.1.3.2 ctype<char> members ........................................................................................................429
22.2.1.3.3 ctype<char> static members ...............................................................................................430
22.2.1.3.4 ctype<char> virtual functions.............................................................................................430
22.2.1.4 Class ctype_byname<char>.........................................................................................................431
22.2.1.5 Class template codecvt............................................................................................................431
22.2.1.5.1 codecvt members ..................................................................................................................432
ISO/IEC 14882:2003(E)
© ISO/IEC 2003 — All rights reserved xvii
22.2.1.5.2 codecvt virtual functions ......................................................................................................433
22.2.1.6 Class template codecvt_byname ...........................................................................................435
22.2.2 The numeric category .....................................................................................................................435
22.2.2.1 Class template num_get............................................................................................................435
22.2.2.1.1 num_get members ..................................................................................................................437
22.2.2.1.2 num_get virtual functions ......................................................................................................437
22.2.2.2 Class template num_put............................................................................................................439
22.2.2.2.1 num_put members ..................................................................................................................440
22.2.2.2.2 num_put virtual functions ......................................................................................................440
22.2.3 The numeric punctuation facet .......................................................................................................443
22.2.3.1 Class template numpunct..........................................................................................................443
22.2.3.1.1 numpunct members ...............................................................................................................444
22.2.3.1.2 numpunct virtual functions ....................................................................................................445
22.2.3.2 Class template numpunct_byname.........................................................................................445
22.2.4 The collate category ........................................................................................................................445
22.2.4.1 Class template collate............................................................................................................445
22.2.4.1.1 collate members ..................................................................................................................446
22.2.4.1.2 collate virtual functions ......................................................................................................446
22.2.4.2 Class template collate_byname ...........................................................................................447
22.2.5 The time category ...........................................................................................................................447
22.2.5.1 Class template time_get..........................................................................................................447
22.2.5.1.1 time_get members ...............................................................................................................448
22.2.5.1.2 time_get virtual functions ....................................................................................................449
22.2.5.2 Class template time_get_byname.........................................................................................450
22.2.5.3 Class template time_put..........................................................................................................450
22.2.5.3.1 time_put members ...............................................................................................................451
22.2.5.3.2 time_put virtual functions ....................................................................................................451
22.2.5.4 Class template time_put_byname.........................................................................................451
22.2.6 The monetary category ...................................................................................................................452
22.2.6.1 Class template money_get .......................................................................................................452
22.2.6.1.1 money_get members .............................................................................................................452
22.2.6.1.2 money_get virtual functions .................................................................................................452
22.2.6.2 Class template money_put .......................................................................................................454
22.2.6.2.1 money_put members .............................................................................................................454
22.2.6.2.2 money_put virtual functions .................................................................................................454
22.2.6.3 Class template moneypunct.....................................................................................................455
22.2.6.3.1 moneypunct members ...........................................................................................................456
22.2.6.3.2 moneypunct virtual functions ...............................................................................................456
22.2.6.4 Class template moneypunct_byname....................................................................................457
22.2.7 The message retrieval category.......................................................................................................458
22.2.7.1 Class template messages..........................................................................................................458
22.2.7.1.1 messages members ...............................................................................................................458
22.2.7.1.2 messages virtual functions ....................................................................................................459
22.2.7.2 Class template messages_byname.........................................................................................459
22.2.8 Program-defined facets ...................................................................................................................459
22.3 C Library Locales ..............................................................................................................................463
23 Containers library .................................................................................................................................465
23.1 Container requirements ......................................................................................................................465
23.1.1 Sequences .......................................................................................................................................468
23.1.2 Associative containers ....................................................................................................................471
ISO/IEC 14882:2003(E)
xviii © ISO/IEC 2003 — All rights reserved
23.2 Sequences ..........................................................................................................................................474
23.2.1 Class template deque....................................................................................................................477
23.2.1.1 deque constructors, copy, and assignment ................................................................................479
23.2.1.2 deque capacity ...........................................................................................................................480
23.2.1.3 deque modifiers .........................................................................................................................480
23.2.1.4 deque specialized algorithms ....................................................................................................480
23.2.2 Class template list ......................................................................................................................481
23.2.2.1 list constructors, copy, and assignment ...................................................................................483
23.2.2.2 list capacity .............................................................................................................................484
23.2.2.3 list modifiers ...........................................................................................................................484
23.2.2.4 list operations ..........................................................................................................................484
23.2.2.5 list specialized algorithms .......................................................................................................486
23.2.3 Container adaptors ..........................................................................................................................486
23.2.3.1 Class template queue.................................................................................................................486
23.2.3.2 Class template priority_queue ...........................................................................................487
23.2.3.2.1 priority_queue constructors ............................................................................................488
23.2.3.2.2 priority_queue members .................................................................................................488
23.2.3.3 Class template stack.................................................................................................................488
23.2.4 Class template vector .................................................................................................................489
23.2.4.1 vector constructors, copy, and assignment ..............................................................................491
23.2.4.2 vector capacity .........................................................................................................................492
23.2.4.3 vector modifiers.......................................................................................................................492
23.2.4.4 vector specialized algorithms ..................................................................................................493
23.2.5 Class vector<bool>..................................................................................................................493
23.3 Associative containers .......................................................................................................................495
23.3.1 Class template map.........................................................................................................................497
23.3.1.1 map constructors, copy, and assignment .....................................................................................499
23.3.1.2 map element access .....................................................................................................................500
23.3.1.3 map operations ............................................................................................................................500
23.3.1.4 map specialized algorithms .........................................................................................................500
23.3.2 Class template multimap.............................................................................................................500
23.3.2.1 multimap constructors..............................................................................................................503
23.3.2.2 multimap operations ................................................................................................................503
23.3.2.3 multimap specialized algorithms .............................................................................................503
23.3.3 Class template set.........................................................................................................................503
23.3.3.1 set constructors, copy, and assignment .....................................................................................505
23.3.3.2 set specialized algorithms .........................................................................................................506
23.3.4 Class template multiset.............................................................................................................506
23.3.4.1 multiset constructors..............................................................................................................508
23.3.4.2 multiset specialized algorithms .............................................................................................508
23.3.5 Class template bitset .................................................................................................................509
23.3.5.1 bitset constructors ..................................................................................................................510
23.3.5.2 bitset members .......................................................................................................................511
23.3.5.3 bitset operators .......................................................................................................................514
24 Iterators library .....................................................................................................................................515
24.1 Iterator requirements ..........................................................................................................................515
24.1.1 Input iterators ..................................................................................................................................516
24.1.2 Output iterators ...............................................................................................................................517
24.1.3 Forward iterators .............................................................................................................................518
24.1.4 Bidirectional iterators .....................................................................................................................519
24.1.5 Random access iterators..................................................................................................................519
ISO/IEC 14882:2003(E)
© ISO/IEC 2003 — All rights reserved xix
24.2 Header <iterator> synopsis ........................................................................................................520
24.3 Iterator primitives ..............................................................................................................................522
24.3.1 Iterator traits....................................................................................................................................522
24.3.2 Basic iterator ...................................................................................................................................523
24.3.3 Standard iterator tags ......................................................................................................................524
24.3.4 Iterator operations ...........................................................................................................................525
24.4 Predefined iterators ............................................................................................................................525
24.4.1 Reverse iterators .............................................................................................................................525
24.4.1.1 Class template reverse_iterator ......................................................................................526
24.4.1.2 reverse_iterator requirements .........................................................................................527
24.4.1.3 reverse_iterator operations .............................................................................................527
24.4.1.3.1 reverse_iterator constructor .........................................................................................527
24.4.1.3.2 Conversion ................................................................................................................................527
24.4.1.3.3 operator*.............................................................................................................................527
24.4.1.3.4 operator-> ..........................................................................................................................528
24.4.1.3.5 operator++ ..........................................................................................................................528
24.4.1.3.6 operator-- ..........................................................................................................................528
24.4.1.3.7 operator+.............................................................................................................................528
24.4.1.3.8 operator+= ..........................................................................................................................528
24.4.1.3.9 operator-.............................................................................................................................529
24.4.1.3.10 operator-= ........................................................................................................................529
24.4.1.3.11 operator[] ........................................................................................................................529
24.4.1.3.12 operator== ........................................................................................................................529
24.4.1.3.13 operator<...........................................................................................................................529
24.4.1.3.14 operator!= ........................................................................................................................529
24.4.1.3.15 operator>...........................................................................................................................529
24.4.1.3.16 operator>= ........................................................................................................................530
24.4.1.3.17 operator<= ........................................................................................................................530
24.4.1.3.18 operator-...........................................................................................................................530
24.4.1.3.19 operator+...........................................................................................................................530
24.4.2 Insert iterators .................................................................................................................................530
24.4.2.1 Class template back_insert_iterator.............................................................................531
24.4.2.2 back_insert_iterator operations ....................................................................................531
24.4.2.2.1 back_insert_iterator constructor ...............................................................................531
24.4.2.2.2 back_insert_iterator::operator=........................................................................531
24.4.2.2.3 back_insert_iterator::operator*........................................................................531
24.4.2.2.4 back_insert_iterator::operator++......................................................................531
24.4.2.2.5 back_inserter ...................................................................................................................532
24.4.2.3 Class template front_insert_iterator ..........................................................................532
24.4.2.4 front_insert_iterator operations .................................................................................532
24.4.2.4.1 front_insert_iterator constructor .............................................................................532
24.4.2.4.2 front_insert_iterator::operator=......................................................................532
24.4.2.4.3 front_insert_iterator::operator*......................................................................532
24.4.2.4.4 front_insert_iterator::operator++ ...................................................................533
24.4.2.4.5 front_inserter.................................................................................................................533
24.4.2.5 Class template insert_iterator.........................................................................................533
24.4.2.6 insert_iterator operations ................................................................................................533
24.4.2.6.1 insert_iterator constructor ...........................................................................................533
24.4.2.6.2 insert_iterator::operator=....................................................................................533
24.4.2.6.3 insert_iterator::operator*....................................................................................534
24.4.2.6.4 insert_iterator::operator++..................................................................................534
24.4.2.6.5 inserter ...............................................................................................................................534
ISO/IEC 14882:2003(E)
xx © ISO/IEC 2003 — All rights reserved
24.5 Stream iterators ..................................................................................................................................534
24.5.1 Class template istream_iterator .........................................................................................534
24.5.1.1 istream_iterator constructors and destructor ...................................................................535
24.5.1.2 istream_iterator operations .............................................................................................535
24.5.2 Class template ostream_iterator .........................................................................................536
24.5.2.1 ostream_iterator constructors and destructor ...................................................................537
24.5.2.2 ostream_iterator operations .............................................................................................537
24.5.3 Class template istreambuf_iterator ..................................................................................537
24.5.3.1 Class template istreambuf_iterator::proxy ..............................................................538
24.5.3.2 istreambuf_iterator constructors ...................................................................................539
24.5.3.3 istreambuf_iterator::operator* .............................................................................539
24.5.3.4 istreambuf_iterator::operator++...........................................................................539
24.5.3.5 istreambuf_iterator::equal.......................................................................................539
24.5.3.6 operator== .............................................................................................................................539
24.5.3.7 operator!= .............................................................................................................................539
24.5.4 Class template ostreambuf_iterator ..................................................................................540
24.5.4.1 ostreambuf_iterator constructors ...................................................................................540
24.5.4.2 ostreambuf_iterator operations ......................................................................................540
25 Algorithms library ................................................................................................................................543
25.1 Non-modifying sequence operations .................................................................................................551
25.1.1 For each ..........................................................................................................................................551
25.1.2 Find .................................................................................................................................................552
25.1.3 Find End..........................................................................................................................................552
25.1.4 Find First.........................................................................................................................................552
25.1.5 Adjacent find ..................................................................................................................................553
25.1.6 Count...............................................................................................................................................553
25.1.7 Mismatch ........................................................................................................................................553
25.1.8 Equal ...............................................................................................................................................554
25.1.9 Search .............................................................................................................................................554
25.2 Mutating sequence operations ...........................................................................................................555
25.2.1 Copy ................................................................................................................................................555
25.2.2 Swap ...............................................................................................................................................555
25.2.3 Transform .......................................................................................................................................556
25.2.4 Replace ...........................................................................................................................................556
25.2.5 Fill ...................................................................................................................................................557
25.2.6 Generate ..........................................................................................................................................557
25.2.7 Remove ...........................................................................................................................................557
25.2.8 Unique.............................................................................................................................................558
25.2.9 Reverse ...........................................................................................................................................558
25.2.10 Rotate ............................................................................................................................................559
25.2.11 Random shuffle .............................................................................................................................559
25.2.12 Partitions .......................................................................................................................................560
25.3 Sorting and related operations ...........................................................................................................560
25.3.1 Sorting.............................................................................................................................................561
25.3.1.1 sort............................................................................................................................................561
25.3.1.2 stable_sort...........................................................................................................................561
25.3.1.3 partial_sort.........................................................................................................................561
25.3.1.4 partial_sort_copy.............................................................................................................562
25.3.2 Nth element .....................................................................................................................................562
25.3.3 Binary search ..................................................................................................................................562
剩余785页未读,继续阅读
126 浏览量
119 浏览量
2018-02-12 上传
2016-07-07 上传
2023-01-11 上传
2011-10-01 上传
点击了解资源详情
点击了解资源详情
点击了解资源详情
shuisheng918
- 粉丝: 1
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- SSM Java项目:StudentInfo 数据管理与可视化分析
- pyedgar:Python库简化EDGAR数据交互与文档下载
- Node.js环境下wfdb文件解码与实时数据处理
- phpcms v2.2企业级网站管理系统发布
- 美团饿了么优惠券推广工具-uniapp源码
- 基于红外传感器的会议室实时占用率测量系统
- DenseNet-201预训练模型:图像分类的深度学习工具箱
- Java实现和弦移调工具:Transposer-java
- phpMyFAQ 2.5.1 Beta多国语言版:技术项目源码共享平台
- Python自动化源码实现便捷自动下单功能
- Android天气预报应用:查看多城市详细天气信息
- PHPTML类:简化HTML页面创建的PHP开源工具
- Biovec在蛋白质分析中的应用:预测、结构和可视化
- EfficientNet-b0深度学习工具箱模型在MATLAB中的应用
- 2024年河北省技能大赛数字化设计开发样题解析
- 笔记本USB加湿器:便携式设计解决方案
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功