Skip to content

Commit e97faa1

Browse files
committed
Started Chapter 11
1 parent 0341c11 commit e97faa1

16 files changed

+80
-59
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
此项目第一阶段计划(泛讲篇前七章)已经完成!
66

7-
### 当前进度:泛讲篇第九章完成。参见[Preview](https://github.com/cppHusky/cppHusky-cpp-Tutorial/releases/tag/preview-0-0-9)
7+
### 当前进度:泛讲篇第十章完成。参见[Preview](https://github.com/cppHusky/cppHusky-cpp-Tutorial/releases/tag/preview-0-0-9)
88

99
我为此规划了一个大致的编章结构,参见[Structure.md](https://github.com/cppHusky/cppHusky-cpp-Tutorial/blob/main/Structure.md)
1010

generalized_part.tex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ \part*{泛讲篇}
99
\import{generalized_parts/}{07_projecting.tex}
1010
\import{generalized_parts/}{08_a_step_forward_in_classes_and_functions.tex}
1111
\import{generalized_parts/}{09_class_inheritance.tex}
12-
\import{generalized_parts/}{10_common_problems_in_inheritance.tex}
12+
\import{generalized_parts/}{10_common_problems_in_inheritance.tex}
13+
\import{generalized_parts/}{11_templates_and_fundamental_generic_programming.tex}

generalized_parts/10_common_problems_in_inheritance/05_virtual_inheritance.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,5 @@ \subsection*{初学者对虚继承的常见困惑}
191191
\subsection*{有关几何图形的完整代码}
192192
代码10.1是有关几何图形问题的完整代码。因为所有内容都是在类内定义的,所以只需要一个头文件就足够了。\par
193193
这段代码中包含了虚函数、抽象基类、多重继承和虚继承的相关知识,读者可以对照注释内容尝试理解。我相信以读者现在的水平,是可以看懂这些代码的。\par
194+
如果难以理解某处的继承关系,记得回去看图10.9。一图胜千言。\par
194195
\lstinputlisting[caption=\texttt{Header.h}]{code_in_book/10.1/Header.h}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
\chapter{模版与泛型编程基础}
2+
本章将介绍C++的两个重要部分:\textbf{泛型编程(Generic programming)}与\textbf{标准模版库(Standard template library, STL)}。其中STL部分不会细讲,留到精讲篇再详细阐述。\par
3+
我们在第四章中已简要了解过函数模版,又在之后的章节中反复用到 \lstinline@std::vector@ 等类模版。在本章,我将带领读者从函数模版到类模版,系统性地学习泛型编程的基本知识,并在这之后完成一个``指能指针''的实操练习。\par
4+
而在本章的末尾,我会带读者了解一些STL的基本知识——尤其是迭代器。它是指针的延伸,但其作用远比指针更加丰富。\par
5+
\import{11_templates_and_fundamental_generic_programming/}{01_function_templates.tex}
6+
\import{11_templates_and_fundamental_generic_programming/}{02_instantiation_and_specialization_of_function_templates.tex}
7+
\import{11_templates_and_fundamental_generic_programming/}{03_class_templates.tex}
8+
\import{11_templates_and_fundamental_generic_programming/}{04_instantiation_and_specialization_of_class_templates.tex}
9+
\import{11_templates_and_fundamental_generic_programming/}{05_exercise_smart_pointers.tex}
10+
\import{11_templates_and_fundamental_generic_programming/}{06_introduction_to_STL.tex}

generalized_parts/11_templates_and_fundamental_generic_programming/01_function_templates.tex

Whitespace-only changes.

generalized_parts/11_templates_and_fundamental_generic_programming/02_instantiation_and_specialization_of_function_templates.tex

Whitespace-only changes.

generalized_parts/11_templates_and_fundamental_generic_programming/03_class_templates.tex

Whitespace-only changes.

generalized_parts/11_templates_and_fundamental_generic_programming/04_instantiation_and_specialization_of_class_templates.tex

Whitespace-only changes.

generalized_parts/11_templates_and_fundamental_generic_programming/05_exercise_smart_pointers.tex

Whitespace-only changes.

generalized_parts/11_templates_and_fundamental_generic_programming/06_introduction_to_STL.tex

Whitespace-only changes.

0 commit comments

Comments
 (0)