<html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
<title>Subject Index, C++ FAQ Lite</title>
<meta name="FILENAME" content="subject-index.html">
<meta name="ABSTRACT" content="Subject Index, C++ FAQ Lite">
<meta name="OWNER" content="cline@parashift.com">
<meta name="AUTHOR" content="Marshall Cline, cline@parashift.com">
<meta http-equiv="Content-Type" content="text/html; charset=iso8859-1">
<link rev=made href="mailto:cline@parashift.com">
<link rel="stylesheet" type="text/css" href="cpp-faq.css" tppabs="http://www.parashift.com/c++-faq-lite/cpp-faq.css">
</head>
<body>
<h1><a name="top"></a>Subject Index<br>
<small><small>(Part of <a href="index.html" tppabs="http://www.parashift.com/c++-faq-lite/index.html"><em>C++ FAQ Lite</em></a>, <a href="copy-permissions.html#[1.2]" tppabs="http://www.parashift.com/c++-faq-lite/copy-permissions.html#[1.2]">Copyright © 1991-2001</a>, <a href="javascript:if(confirm('http://www.parashift.com/ \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://www.parashift.com/'" tppabs="http://www.parashift.com/" target=OutsideTheFAQ>Marshall Cline</a>, <a href="mailto:cline@parashift.com">cline@parashift.com</a>)</small></small></h1>
<hr>
<p><a name="A"></a>
<p><big>"A" </big> [ <a href="#top">Top</a> | A | <a href="#B">B</a> | <a href="#C">C</a> | <a href="#D">D</a> | <a href="#E">E</a> | <a href="#F">F</a> | <a href="#G">G</a> | <a href="#H">H</a> | <a href="#I">I</a> | <a href="#J">J</a> | <a href="#K">K</a> | <a href="#L">L</a> | <a href="#M">M</a> | <a href="#N">N</a> | <a href="#O">O</a> | <a href="#P">P</a> | <a href="#Q">Q</a> | <a href="#R">R</a> | <a href="#S">S</a> | <a href="#T">T</a> | <a href="#U">U</a> | <a href="#V">V</a> | <a href="#W">W</a> | <a href="#X">X</a> | <a href="#Y">Y</a> | <a href="#Z">Z</a> | <a href="#bottom">Bottom</a>]
<ul>
<li>A2PS (see Pretty printing) ... <a href="misc-environmental-issues.html#[35.2]" tppabs="http://www.parashift.com/c++-faq-lite/misc-environmental-issues.html#[35.2]">[35.2]</a></li>
<li>ABC (see also Inheritance) ... <a href="abcs.html#[22.2]" tppabs="http://www.parashift.com/c++-faq-lite/abcs.html#[22.2]">[22.2]</a>, <a href="abcs.html#[22.3]" tppabs="http://www.parashift.com/c++-faq-lite/abcs.html#[22.3]">[22.3]</a></li>
<li>Access rules
<ul>
<li><tt>protected:</tt> and <tt>private:</tt> inheritance ... <a href="private-inheritance.html#[24.6]" tppabs="http://www.parashift.com/c++-faq-lite/private-inheritance.html#[24.6]">[24.6]</a></li>
<li><tt>protected:</tt> and <tt>private:</tt> members ... <a href="basics-of-inheritance.html#[19.5]" tppabs="http://www.parashift.com/c++-faq-lite/basics-of-inheritance.html#[19.5]">[19.5]</a>, <a href="basics-of-inheritance.html#[19.6]" tppabs="http://www.parashift.com/c++-faq-lite/basics-of-inheritance.html#[19.6]">[19.6]</a></li>
</ul>
</li>
<li>Acronyms ... <a href="how-to-post.html#[5.1]" tppabs="http://www.parashift.com/c++-faq-lite/how-to-post.html#[5.1]">[5.1]</a></li>
<li>Ada <i>vs.</i> C++ ... <a href="big-picture.html#[6.4]" tppabs="http://www.parashift.com/c++-faq-lite/big-picture.html#[6.4]">[6.4]</a></li>
<li>AFAICS (Acronym) ... <a href="how-to-post.html#[5.1]" tppabs="http://www.parashift.com/c++-faq-lite/how-to-post.html#[5.1]">[5.1]</a></li>
<li>Aggregation (see also Composition) ... <a href="private-inheritance.html#[24.2]" tppabs="http://www.parashift.com/c++-faq-lite/private-inheritance.html#[24.2]">[24.2]</a></li>
<li>Aliasing
<ul>
<li>Aliasing of <tt>const</tt> and non-<tt>const</tt> pointers ... <a href="const-correctness.html#[18.9]" tppabs="http://www.parashift.com/c++-faq-lite/const-correctness.html#[18.9]">[18.9]</a>, <a href="const-correctness.html#[18.11]" tppabs="http://www.parashift.com/c++-faq-lite/const-correctness.html#[18.11]">[18.11]</a>, <a href="const-correctness.html#[18.12]" tppabs="http://www.parashift.com/c++-faq-lite/const-correctness.html#[18.12]">[18.12]</a>, <a href="const-correctness.html#[18.13]" tppabs="http://www.parashift.com/c++-faq-lite/const-correctness.html#[18.13]">[18.13]</a></li>
<li>References are aliases for objects ... <a href="references.html#[8.1]" tppabs="http://www.parashift.com/c++-faq-lite/references.html#[8.1]">[8.1]</a>, <a href="references.html#[8.6]" tppabs="http://www.parashift.com/c++-faq-lite/references.html#[8.6]">[8.6]</a></li>
</ul>
</li>
<li>All Terrain Vehicle (ATV) ... <a href="smalltalk.html#[27.5]" tppabs="http://www.parashift.com/c++-faq-lite/smalltalk.html#[27.5]">[27.5]</a></li>
<li>ANSI ... <a href="big-picture.html#[6.11]" tppabs="http://www.parashift.com/c++-faq-lite/big-picture.html#[6.11]">[6.11]</a>
<ul>
<li>ANSI C ... <a href="big-picture.html#[6.10]" tppabs="http://www.parashift.com/c++-faq-lite/big-picture.html#[6.10]">[6.10]</a></li>
<li>ANSI C++ ... <a href="big-picture.html#[6.12]" tppabs="http://www.parashift.com/c++-faq-lite/big-picture.html#[6.12]">[6.12]</a></li>
<li>ANSI C++ committee "X3J16" ... <a href="big-picture.html#[6.11]" tppabs="http://www.parashift.com/c++-faq-lite/big-picture.html#[6.11]">[6.11]</a>, <a href="smalltalk.html#[27.1]" tppabs="http://www.parashift.com/c++-faq-lite/smalltalk.html#[27.1]">[27.1]</a></li>
</ul>
</li>
<li>Arity ... <a href="operator-overloading.html#[13.7]" tppabs="http://www.parashift.com/c++-faq-lite/operator-overloading.html#[13.7]">[13.7]</a></li>
<li>Arrays
<ul>
<li>Arrays are evil ... <a href="freestore-mgmt.html#[16.16]" tppabs="http://www.parashift.com/c++-faq-lite/freestore-mgmt.html#[16.16]">[16.16]</a>, <a href="exceptions.html#[17.5]" tppabs="http://www.parashift.com/c++-faq-lite/exceptions.html#[17.5]">[17.5]</a>, <a href="containers-and-templates.html#[31.1]" tppabs="http://www.parashift.com/c++-faq-lite/containers-and-templates.html#[31.1]">[31.1]</a></li>
<li>Specifying length at runtime ... <a href="freestore-mgmt.html#[16.19]" tppabs="http://www.parashift.com/c++-faq-lite/freestore-mgmt.html#[16.19]">[16.19]</a></li>
</ul>
</li>
<li>Artistic Style (see Pretty Printing) ... <a href="misc-environmental-issues.html#[35.2]" tppabs="http://www.parashift.com/c++-faq-lite/misc-environmental-issues.html#[35.2]">[35.2]</a></li>
<li>Assigning a reference ... <a href="references.html#[8.2]" tppabs="http://www.parashift.com/c++-faq-lite/references.html#[8.2]">[8.2]</a></li>
<li>Assignment operator ... <a href="assignment-operators.html" tppabs="http://www.parashift.com/c++-faq-lite/assignment-operators.html">[12]</a>
<ul>
<li>Check for self-assignment ... <a href="abcs.html#[22.5]" tppabs="http://www.parashift.com/c++-faq-lite/abcs.html#[22.5]">[22.5]</a>, <a href="coding-standards.html#[25.9]" tppabs="http://www.parashift.com/c++-faq-lite/coding-standards.html#[25.9]">[25.9]</a></li>
<li>Return <tt>*this</tt> ... <a href="coding-standards.html#[25.9]" tppabs="http://www.parashift.com/c++-faq-lite/coding-standards.html#[25.9]">[25.9]</a></li>
<li>Self-assignment ... <a href="assignment-operators.html#[12.1]" tppabs="http://www.parashift.com/c++-faq-lite/assignment-operators.html#[12.1]">[12.1]</a>, <a href="assignment-operators.html#[12.2]" tppabs="http://www.parashift.com/c++-faq-lite/assignment-operators.html#[12.2]">[12.2]</a>, <a href="assignment-operators.html#[12.3]" tppabs="http://www.parashift.com/c++-faq-lite/assignment-operators.html#[12.3]">[12.3]</a></li>
<li>Use <tt>const</tt> in parameter ... <a href="coding-standards.html#[25.9]" tppabs="http://www.parashift.com/c++-faq-lite/coding-standards.html#[25.9]">[25.9]</a></li>
</ul>
</li>
<li>Associative array (see also STL) ... <a href="containers-and-templates.html#[31.2]" tppabs="http://www.parashift.com/c++-faq-lite/containers-and-templates.html#[31.2]">[31.2]</a></li>
<li>Associativity ... <a href="operator-overloading.html#[13.7]" tppabs="htt
c++-faq-lite
需积分: 0 63 浏览量
更新于2008-11-20
收藏 266KB RAR 举报
《C++ FAQ Lite》是由Marshall Cline撰写的一份关于C++编程语言的权威参考文档。这份文档在C++开发者中具有极高的知名度和影响力,它涵盖了C++语言的众多重要概念、特性和最佳实践,旨在帮助程序员解决实际开发过程中遇到的问题。
1. **对象与类**:C++是面向对象的编程语言,对象和类是其核心概念。对象是类的实例,类定义了对象的状态(数据成员)和行为(成员函数)。C++支持公有、私有和保护访问权限,以实现封装。
2. **构造与析构**:C++允许定义构造函数来初始化新创建的对象,以及析构函数来清理对象不再使用时的资源。了解何时自动调用这些函数对于防止内存泄漏至关重要。
3. **继承与多态**:继承允许一个类(子类)从另一个类(基类)继承属性和行为。多态是通过虚函数实现的,它允许不同的对象对同一消息做出不同的响应,增强了代码的灵活性和可扩展性。
4. **模板**:C++的模板是一种泛型编程工具,可以用于创建函数和类,以处理不同类型的参数,实现代码复用。模板元编程则是模板技术的一种高级应用,用于在编译时进行计算。
5. **异常处理**:C++通过try、catch和throw关键字支持异常处理,提供了一种处理运行时错误的方式,避免程序因未捕获的异常而崩溃。
6. **STL(标准模板库)**:STL包括容器(如vector、list、set等)、迭代器、算法和函数对象,是C++的标准组件,极大地提高了开发效率。
7. **命名空间**:命名空间用于避免全局命名冲突,提供了一种组织代码的方式。使用using声明或指令可以方便地访问命名空间中的元素。
8. **指针与引用**:指针是C++的特色,它可以存储其他对象的地址,而引用则是一种别名,它总是引用另一个对象,不能为NULL,也不可改变引用本身。
9. **内存管理**:C++提供了动态内存分配(new和delete操作符)和智能指针(如auto_ptr、unique_ptr、shared_ptr),以帮助开发者管理内存,防止内存泄漏和悬挂指针。
10. **运算符重载**:C++允许对运算符进行重载,以提供自定义类型的操作方式,如自增自减运算符、比较运算符等。
11. **函数重载与模板重载**:函数重载允许在同一作用域内用相同名称但参数列表不同的函数,而模板重载则是在模板上下文中实现相同功能但参数类型不同的函数。
12. **C++11及后续版本的新特性**:C++11引入了lambda表达式、右值引用、类型推断(auto关键字)、move语义、强类型枚举等,后续的C++14和C++17继续扩展了这些特性,提升了C++的现代性和效率。
《C++ FAQ Lite》详尽地讨论了这些话题,每个问题都配有清晰的解释和示例代码,是C++程序员不可或缺的学习资料。通过深入学习和实践,开发者能够更好地理解和掌握C++的精髓,提升编程技能。