没有合适的资源?快使用搜索试试~ 我知道了~
首页C++03标准文档:ISO/IEC 14882:2003(E)英文版
"ISO/IEC 14882:2003(E) C++03标准英文版,带有书签"
这篇文档是国际标准化组织(ISO)和国际电工委员会(IEC)联合发布的第二版C++编程语言标准,通常被称为C++03标准。该标准在2003年10月15日发布,并被美国国家标准学会(ANSI)采纳为美国国家标准。此版本的C++标准详细定义了语言的语法、语义和库,旨在为C++程序员提供一个统一的参考框架。
C++03标准引入了许多关键概念和特性,包括:
1. **模板元编程**:允许在编译时进行计算,增强了模板的功能,使得开发者可以创建更为复杂和高效的代码。
2. **异常处理**:定义了如何在程序中处理错误,通过`try`、`catch`和`throw`关键字来实现异常的抛出和捕获。
3. **命名空间(Namespaces)**:提供了避免命名冲突的方式,使代码更易于管理和维护。
4. **智能指针**:如`auto_ptr`,是C++对自动内存管理的一种尝试,它能在对象生命周期结束后自动释放内存。
5. **STL(标准模板库)**:包括容器(如`vector`、`list`、`map`等)、迭代器、算法和函数对象,是C++的核心组成部分。
6. **内联函数和函数重载**:内联函数用于优化程序性能,函数重载则允许同一函数名根据不同的参数列表有不同的实现。
7. **构造函数和析构函数**:C++中的对象生命周期管理,特别是对于类的对象,确保正确初始化和清理资源。
8. **运算符重载**:允许为自定义类型重新定义运算符的行为。
9. **多态性(Polymorphism)**:通过虚函数和抽象类实现,是面向对象编程的重要特性。
10. **静态与动态绑定**:静态绑定(早期绑定)主要针对函数调用和成员访问,而动态绑定(晚期绑定)针对虚函数调用。
此外,C++03标准还规定了标准库的详细内容,包括输入/输出流、字符串、容器、算法、智能指针和其他实用工具。这些规范有助于确保跨平台的兼容性和代码的可移植性。
请注意,C++03标准已经被后来的C++11、C++14、C++17、C++20等新版本所取代,每个新版本都引入了更多的现代特性和改进,如右值引用、lambda表达式、并发支持和更多库的增强。然而,理解C++03仍然是理解和学习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页未读,继续阅读
点击了解资源详情
点击了解资源详情
点击了解资源详情
2019-06-11 上传
2021-10-03 上传
2022-09-23 上传
2013-05-16 上传
2012-02-08 上传
2021-03-17 上传
microsoftoflife
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 实战Dojo工具包 实战Dojo工具包
- sql教程sqlsqlsqlsql
- linux网络编程.pdf
- 3G技术讲解(化为)
- weblogic guide 中文教程
- 华清远见vxworks的资料
- numbers-parser:工作正在进行中
- Accuinsight-1.0.27-py2.py3-none-any.whl.zip
- FrequencyViewer:简单的 Android 监听器和频率绘图仪
- todo-RestApi-mongoDB
- QT
- my_site:criando umapágina简单-Estudo
- go-gorm-example
- 语法列表:采用字符串元胞数组,并根据标准语法返回带有逗号和“和”的单个字符串-matlab开发
- Face-Detector
- e16-3yp-智能红外射击运动
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功