Item1 : view C++ as a federation of languages
1. C++ 相当于C的改进:
Exception 对函数的结构化
Templates
STL
2. C++:多重泛型编程语言(multiparadigm programming language )
同时支持过程形式(procedural)
面向对象编程(object-oriented)
函数形式(functional)
泛型模式(generic)
元编程模式(metaprogramming)
3. C++是由多个相关语言组成的,4点:
① C
blocks ,statements ,preprocessors ,built-in data types ,arrays ,pointers 等传统来自于C,而templates ,exceptions ,overloading则是C语言的局限。
② Object-oriented C++
Classes(included constructor ,destructor ),encapsulation,inheritance,polymorphism,virtual function(dynamic binding)…则是面向对象设计之古典守则在C++上的最直接实施。
③ Template C++:是C++的泛型编程部分
④ STL: template程序库
它对容器(containers),迭代器(iterators),算法(algorithms)以及函数对象(function objects)的规约有极佳的紧密配合与协调。