没有合适的资源?快使用搜索试试~ 我知道了~
首页ISO/IEC 14882:1998(E) - C++编程语言标准
ISO/IEC 14882:1998(E) - C++编程语言标准
需积分: 10 1 下载量 180 浏览量
更新于2024-07-16
收藏 28.66MB PDF 举报
"ISO-IEC 14882-C++[1st-1998]&CP.pdf" 是一份关于C++编程语言的国际标准文档,由国际标准化组织(ISO)和国际电工委员会(IEC)联合发布,首次出版于1998年9月1日。这个标准被美国国家标准学会(ANSI)采纳并批准为美国国家标准。文档的版权归属于国际信息技术工业理事会(ITI),并明确指出未经许可,不得复制或销售此文档的任何部分。
文档的主要内容是C++编程语言的标准定义,它定义了C++语言的语法、语义以及程序员可以使用的各种特性。C++是一种面向对象的编程语言,由Bjarne Stroustrup在C语言的基础上发展而来,旨在提供更高级别的抽象,同时保持底层性能。
C++标准包括以下几个关键方面:
1. **基本概念**:定义了C++语言的基本元素,如变量、类型、运算符、控制结构(如循环和条件语句)等。
2. **类和对象**:这是C++的核心特性,允许程序员创建自定义数据类型,并通过封装、继承和多态来实现面向对象的设计。
3. **模板**:C++中的模板允许创建泛型代码,可以应用于多种数据类型,增加了代码的复用性。
4. **异常处理**:提供了一种结构化的错误处理机制,允许程序在遇到异常情况时进行恢复,而不是导致程序崩溃。
5. **输入/输出(I/O)系统**:包括iostream库,提供了一套用于读写标准输入输出(如屏幕和键盘)和其他文件的流操作。
6. **标准库**:C++标准库提供了大量预先编写好的函数和容器,如算法、字符串、容器(如vector和list)、迭代器等,极大地增强了开发效率。
7. **命名空间**:命名空间有助于解决全局名字冲突问题,使得大型项目中的代码组织更加清晰。
8. **内存管理**:C++提供了对内存的直接控制,包括动态内存分配和释放,同时也支持智能指针以帮助防止内存泄漏。
9. **预处理器**:C++的预处理器可以扩展源代码,允许宏定义和条件编译。
10. **程序链接**:描述了如何将多个源文件编译和链接成一个可执行程序的过程。
此标准文档是所有C++开发者的重要参考,它确保了不同平台和编译器下的C++代码的一致性和可移植性。遵循该标准可以帮助程序员编写出高效、可靠且易于维护的代码。然而,由于版权原因,获取和使用该标准文档应遵循ITI的规定,不能未经授权进行复制或销售。
ISO/IEC 14882:1998(E) © ISO/IEC
22.2.1.5.2 codecvt virtual functions ......................................................................................................427
22.2.1.6 Template class codecvt_byname...........................................................................................429
22.2.2 The numeric category .....................................................................................................................429
22.2.2.1 Template class num_get............................................................................................................429
22.2.2.1.1 num_get members ..................................................................................................................431
22.2.2.1.2 num_get virtual functions ......................................................................................................431
22.2.2.2 Template class num_put............................................................................................................433
22.2.2.2.1 num_put members ..................................................................................................................434
22.2.2.2.2 num_put virtual functions ......................................................................................................434
22.2.3 The numeric punctuation facet .......................................................................................................437
22.2.3.1 Template class numpunct .........................................................................................................437
22.2.3.1.1 numpunct members ...............................................................................................................438
22.2.3.1.2 numpunct virtual functions ....................................................................................................439
22.2.3.2 Template class numpunct_byname ........................................................................................439
22.2.4 The collate category ........................................................................................................................439
22.2.4.1 Template class collate............................................................................................................439
22.2.4.1.1 collate members ..................................................................................................................440
22.2.4.1.2 collate virtual functions ......................................................................................................440
22.2.4.2 Template class collate_byname...........................................................................................441
22.2.5 The time category ...........................................................................................................................441
22.2.5.1 Template class time_get .........................................................................................................441
22.2.5.1.1 time_get members ...............................................................................................................442
22.2.5.1.2 time_get virtual functions ....................................................................................................443
22.2.5.2 Template class time_get_byname ........................................................................................444
22.2.5.3 Template class time_put .........................................................................................................444
22.2.5.3.1 time_put members ...............................................................................................................445
22.2.5.3.2 time_put virtual functions ....................................................................................................445
22.2.5.4 Template class time_put_byname ........................................................................................445
22.2.6 The monetary category ...................................................................................................................446
22.2.6.1 Template class money_get.......................................................................................................446
22.2.6.1.1 money_get members .............................................................................................................446
22.2.6.1.2 money_get virtual functions .................................................................................................446
22.2.6.2 Template class money_put.......................................................................................................448
22.2.6.2.1 money_put members .............................................................................................................448
22.2.6.2.2 money_put virtual functions .................................................................................................448
22.2.6.3 Template class moneypunct ....................................................................................................449
22.2.6.3.1 moneypunct members ...........................................................................................................450
22.2.6.3.2 moneypunct virtual functions ...............................................................................................450
22.2.6.4 Template class moneypunct_byname....................................................................................451
22.2.7 The message retrieval category.......................................................................................................452
22.2.7.1 Template class messages .........................................................................................................452
22.2.7.1.1 messages members ...............................................................................................................452
22.2.7.1.2 messages virtual functions ....................................................................................................453
22.2.7.2 Template class messages_byname ........................................................................................453
22.2.8 Program-defined facets ...................................................................................................................453
22.3 C Library Locales ..............................................................................................................................457
23 Containers library .................................................................................................................................459
23.1 Container requirements ......................................................................................................................459
23.1.1 Sequences .......................................................................................................................................462
23.1.2 Associative containers ....................................................................................................................464
xvi
© ISO/IEC ISO/IEC 14882:1998(E)
23.2 Sequences ..........................................................................................................................................467
23.2.1 Template class deque ...................................................................................................................470
23.2.1.1 deque constructors, copy, and assignment ................................................................................472
23.2.1.2 deque capacity ...........................................................................................................................473
23.2.1.3 deque modifiers .........................................................................................................................473
23.2.1.4 deque specialized algorithms ....................................................................................................473
23.2.2 Template class list......................................................................................................................474
23.2.2.1 list constructors, copy, and assignment ...................................................................................476
23.2.2.2 list capacity .............................................................................................................................477
23.2.2.3 list modifiers ...........................................................................................................................477
23.2.2.4 list operations ..........................................................................................................................477
23.2.2.5 list specialized algorithms .......................................................................................................479
23.2.3 Container adaptors ..........................................................................................................................479
23.2.3.1 Template class queue ................................................................................................................479
23.2.3.2 Template class priority_queue...........................................................................................480
23.2.3.2.1 priority_queue constructors ............................................................................................481
23.2.3.2.2 priority_queue members .................................................................................................481
23.2.3.3 Template class stack ................................................................................................................481
23.2.4 Template class vector.................................................................................................................482
23.2.4.1 vector constructors, copy, and assignment ..............................................................................484
23.2.4.2 vector capacity .........................................................................................................................485
23.2.4.3 vector modifiers.......................................................................................................................485
23.2.4.4 vector specialized algorithms ..................................................................................................486
23.2.5 Class vector<bool>..................................................................................................................486
23.3 Associative containers .......................................................................................................................488
23.3.1 Template class map ........................................................................................................................490
23.3.1.1 map constructors, copy, and assignment .....................................................................................492
23.3.1.2 map element access .....................................................................................................................493
23.3.1.3 map operations ............................................................................................................................493
23.3.1.4 map specialized algorithms .........................................................................................................493
23.3.2 Template class multimap ............................................................................................................493
23.3.2.1 multimap constructors..............................................................................................................496
23.3.2.2 multimap operations ................................................................................................................496
23.3.2.3 multimap specialized algorithms .............................................................................................496
23.3.3 Template class set ........................................................................................................................496
23.3.3.1 set constructors, copy, and assignment .....................................................................................498
23.3.3.2 set specialized algorithms .........................................................................................................499
23.3.4 Template class multiset ............................................................................................................499
23.3.4.1 multiset constructors..............................................................................................................501
23.3.4.2 multiset specialized algorithms .............................................................................................501
23.3.5 Template class bitset.................................................................................................................502
23.3.5.1 bitset constructors ..................................................................................................................503
23.3.5.2 bitset members .......................................................................................................................504
23.3.5.3 bitset operators .......................................................................................................................506
24 Iterators library .....................................................................................................................................509
24.1 Iterator requirements ..........................................................................................................................509
24.1.1 Input iterators ..................................................................................................................................510
24.1.2 Output iterators ...............................................................................................................................511
24.1.3 Forward iterators .............................................................................................................................512
24.1.4 Bidirectional iterators .....................................................................................................................513
24.1.5 Random access iterators..................................................................................................................513
xvii
ISO/IEC 14882:1998(E) © ISO/IEC
24.2 Header <iterator> synopsis ........................................................................................................514
24.3 Iterator primitives ..............................................................................................................................516
24.3.1 Iterator traits....................................................................................................................................516
24.3.2 Basic iterator ...................................................................................................................................517
24.3.3 Standard iterator tags ......................................................................................................................518
24.3.4 Iterator operations ...........................................................................................................................519
24.4 Predefined iterators ............................................................................................................................519
24.4.1 Reverse iterators .............................................................................................................................519
24.4.1.1 Template class reverse_iterator......................................................................................520
24.4.1.2 reverse_iterator requirements .........................................................................................521
24.4.1.3 reverse_iterator operations .............................................................................................521
24.4.1.3.1 reverse_iterator constructor .........................................................................................521
24.4.1.3.2 Conversion ................................................................................................................................521
24.4.1.3.3 operator*.............................................................................................................................521
24.4.1.3.4 operator-> ..........................................................................................................................522
24.4.1.3.5 operator++ ..........................................................................................................................522
24.4.1.3.6 operator-- ..........................................................................................................................522
24.4.1.3.7 operator+.............................................................................................................................522
24.4.1.3.8 operator+= ..........................................................................................................................522
24.4.1.3.9 operator-.............................................................................................................................523
24.4.1.3.10 operator-= ........................................................................................................................523
24.4.1.3.11 operator[] ........................................................................................................................523
24.4.1.3.12 operator== ........................................................................................................................523
24.4.1.3.13 operator<...........................................................................................................................523
24.4.1.3.14 operator!= ........................................................................................................................523
24.4.1.3.15 operator>...........................................................................................................................523
24.4.1.3.16 operator>= ........................................................................................................................524
24.4.1.3.17 operator<= ........................................................................................................................524
24.4.1.3.18 operator-...........................................................................................................................524
24.4.1.3.19 operator+...........................................................................................................................524
24.4.2 Insert iterators .................................................................................................................................524
24.4.2.1 Template class back_insert_iterator ............................................................................525
24.4.2.2 back_insert_iterator operations ....................................................................................525
24.4.2.2.1 back_insert_iterator constructor ...............................................................................525
24.4.2.2.2 back_insert_iterator::operator=........................................................................525
24.4.2.2.3 back_insert_iterator::operator*........................................................................525
24.4.2.2.4 back_insert_iterator::operator++......................................................................525
24.4.2.2.5 back_inserter ...................................................................................................................526
24.4.2.3 Template class front_insert_iterator..........................................................................526
24.4.2.4 front_insert_iterator operations .................................................................................526
24.4.2.4.1 front_insert_iterator constructor .............................................................................526
24.4.2.4.2 front_insert_iterator::operator=......................................................................526
24.4.2.4.3 front_insert_iterator::operator*......................................................................526
24.4.2.4.4 front_insert_iterator::operator++ ...................................................................527
24.4.2.4.5 front_inserter.................................................................................................................527
24.4.2.5 Template class insert_iterator ........................................................................................527
24.4.2.6 insert_iterator operations ................................................................................................527
24.4.2.6.1 insert_iterator constructor ...........................................................................................527
24.4.2.6.2 insert_iterator::operator=....................................................................................527
24.4.2.6.3 insert_iterator::operator*....................................................................................528
24.4.2.6.4 insert_iterator::operator++..................................................................................528
24.4.2.6.5 inserter ...............................................................................................................................528
xviii
© ISO/IEC ISO/IEC 14882:1998(E)
24.5 Stream iterators ..................................................................................................................................528
24.5.1 Template class istream_iterator.........................................................................................528
24.5.1.1 istream_iterator constructors and destructor ...................................................................529
24.5.1.2 istream_iterator operations .............................................................................................529
24.5.2 Template class ostream_iterator.........................................................................................530
24.5.2.1 ostream_iterator constructors and destructor ...................................................................531
24.5.2.2 ostream_iterator operations .............................................................................................531
24.5.3 Template class istreambuf_iterator..................................................................................531
24.5.3.1 Template class istreambuf_iterator::proxy..............................................................532
24.5.3.2 istreambuf_iterator constructors ...................................................................................533
24.5.3.3 istreambuf_iterator::operator* .............................................................................533
24.5.3.4 istreambuf_iterator::operator++...........................................................................533
24.5.3.5 istreambuf_iterator::equal.......................................................................................533
24.5.3.6 operator== .............................................................................................................................533
24.5.3.7 operator!= .............................................................................................................................534
24.5.4 Template class ostreambuf_iterator..................................................................................534
24.5.4.1 ostreambuf_iterator constructors ...................................................................................534
24.5.4.2 ostreambuf_iterator operations ......................................................................................534
25 Algorithms library ................................................................................................................................537
25.1 Non-modifying sequence operations .................................................................................................545
25.1.1 For each ..........................................................................................................................................545
25.1.2 Find .................................................................................................................................................546
25.1.3 Find End..........................................................................................................................................546
25.1.4 Find First.........................................................................................................................................546
25.1.5 Adjacent find ..................................................................................................................................547
25.1.6 Count...............................................................................................................................................547
25.1.7 Mismatch ........................................................................................................................................547
25.1.8 Equal ...............................................................................................................................................548
25.1.9 Search .............................................................................................................................................548
25.2 Mutating sequence operations ...........................................................................................................549
25.2.1 Copy ................................................................................................................................................549
25.2.2 Swap ...............................................................................................................................................549
25.2.3 Transform .......................................................................................................................................550
25.2.4 Replace ...........................................................................................................................................550
25.2.5 Fill ...................................................................................................................................................551
25.2.6 Generate ..........................................................................................................................................551
25.2.7 Remove ...........................................................................................................................................551
25.2.8 Unique.............................................................................................................................................552
25.2.9 Reverse ...........................................................................................................................................552
25.2.10 Rotate ............................................................................................................................................553
25.2.11 Random shuffle .............................................................................................................................553
25.2.12 Partitions .......................................................................................................................................554
25.3 Sorting and related operations ...........................................................................................................554
25.3.1 Sorting.............................................................................................................................................555
25.3.1.1 sort............................................................................................................................................555
25.3.1.2 stable_sort...........................................................................................................................555
25.3.1.3 partial_sort.........................................................................................................................555
25.3.1.4 partial_sort_copy.............................................................................................................556
25.3.2 Nth element .....................................................................................................................................556
25.3.3 Binary search ..................................................................................................................................556
xix
ISO/IEC 14882:1998(E) © ISO/IEC
25.3.3.1 lower_bound...........................................................................................................................556
25.3.3.2 upper_bound...........................................................................................................................557
25.3.3.3 equal_range...........................................................................................................................557
25.3.3.4 binary_search ......................................................................................................................557
25.3.4 Merge ..............................................................................................................................................558
25.3.5 Set operations on sorted structures .................................................................................................558
25.3.5.1 includes ..................................................................................................................................559
25.3.5.2 set_union................................................................................................................................559
25.3.5.3 set_intersection...............................................................................................................559
25.3.5.4 set_difference....................................................................................................................560
25.3.5.5 set_symmetric_difference............................................................................................560
25.3.6 Heap operations ..............................................................................................................................560
25.3.6.1 push_heap................................................................................................................................561
25.3.6.2 pop_heap ..................................................................................................................................561
25.3.6.3 make_heap................................................................................................................................561
25.3.6.4 sort_heap................................................................................................................................561
25.3.7 Minimum and maximum ................................................................................................................562
25.3.8 Lexicographical comparison ...........................................................................................................562
25.3.9 Permutation generators ...................................................................................................................563
25.4 C library algorithms ...........................................................................................................................563
26 Numerics library ...................................................................................................................................565
26.1 Numeric type requirements ................................................................................................................565
26.2 Complex numbers ..............................................................................................................................566
26.2.1 Header <complex> synopsis .......................................................................................................566
26.2.2 Template class complex...............................................................................................................567
26.2.3 complex specializations ...............................................................................................................569
26.2.4 complex member functions..........................................................................................................570
26.2.5 complex member operators..........................................................................................................570
26.2.6 complex non-member operations ................................................................................................571
26.2.7 complex value operations ............................................................................................................572
26.2.8 complex transcendentals ..............................................................................................................573
26.3 Numeric arrays ...................................................................................................................................574
26.3.1 Header <valarray> synopsis .....................................................................................................574
26.3.2 Template class valarray ............................................................................................................577
26.3.2.1 valarray constructors..............................................................................................................578
26.3.2.2 valarray assignment ...............................................................................................................579
26.3.2.3 valarray element access .........................................................................................................580
26.3.2.4 valarray subset operations .....................................................................................................580
26.3.2.5 valarray unary operators ........................................................................................................580
26.3.2.6 valarray computed assignment ..............................................................................................581
26.3.2.7 valarray member functions ....................................................................................................581
26.3.3 valarray non-member operations ..............................................................................................583
26.3.3.1 valarray binary operators .......................................................................................................583
26.3.3.2 valarray logical operators ......................................................................................................584
26.3.3.3 valarray transcendentals.........................................................................................................585
26.3.4 Class slice...................................................................................................................................585
26.3.4.1 slice constructors .....................................................................................................................585
26.3.4.2 slice access functions ..............................................................................................................586
26.3.5 Template class slice_array.....................................................................................................586
xx
剩余6828页未读,继续阅读
2013-12-10 上传
2013-05-16 上传
2022-09-23 上传
2022-09-19 上传
2011-04-03 上传
2022-09-14 上传
2022-09-23 上传
2011-01-08 上传
2022-09-23 上传
qhx19870506
- 粉丝: 1
- 资源: 35
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 火炬连体网络在MNIST的2D嵌入实现示例
- Angular插件增强Application Insights JavaScript SDK功能
- 实时三维重建:InfiniTAM的ros驱动应用
- Spring与Mybatis整合的配置与实践
- Vozy前端技术测试深入体验与模板参考
- React应用实现语音转文字功能介绍
- PHPMailer-6.6.4: PHP邮件收发类库的详细介绍
- Felineboard:为猫主人设计的交互式仪表板
- PGRFileManager:功能强大的开源Ajax文件管理器
- Pytest-Html定制测试报告与源代码封装教程
- Angular开发与部署指南:从创建到测试
- BASIC-BINARY-IPC系统:进程间通信的非阻塞接口
- LTK3D: Common Lisp中的基础3D图形实现
- Timer-Counter-Lister:官方源代码及更新发布
- Galaxia REST API:面向地球问题的解决方案
- Node.js模块:随机动物实例教程与源码解析
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功