![](https://csdnimg.cn/release/download_crawler_static/8605849/bg12.jpg)
4 Notes to the Reader Chapter 1
C
++
language. If nothing else, these chapters should convince you that C
++
isn’t (just) C and that
C
++
has come a long way since the first and second editions of this book. Chapter 2 gives a high-
level acquaintance with C
++
. The discussion focuses on the language features supporting data
abstraction, object-oriented programming, and generic programming. Chapter 3 introduces the
basic principles and major facilities of the standard library. This allows me to use standard library
facilities in the following chapters. It also allows you to use library facilities in exercises rather
than relying directly on lower-level, built-in features.
The introductory chapters provide an example of a general technique that is applied throughout
this book: to enable a more direct and realistic discussion of some technique or feature, I occasion-
ally present a concept briefly at first and then discuss it in depth later. This approach allows me to
present concrete examples before a more general treatment of a topic. Thus, the organization of
this book reflects the observation that we usually learn best by progressing from the concrete to the
abstract – even where the abstract seems simple and obvious in retrospect.
Part I describes the subset of C
++
that supports the styles of programming traditionally done in
C or Pascal. It covers fundamental types, expressions, and control structures for C
++
programs.
Modularity – as supported by namespaces, source files, and exception handling – is also discussed.
I assume that you are familiar with the fundamental programming concepts used in Part I. For
example, I explain C
++
’s facilities for expressing recursion and iteration, but I do not spend much
time explaining how these concepts are useful.
Part II describes C
++
’s facilities for defining and using new types. Concrete and abstract
classes (interfaces) are presented here (Chapter 10, Chapter 12), together with operator overloading
(Chapter 11), polymorphism, and the use of class hierarchies (Chapter 12, Chapter 15). Chapter 13
presents templates, that is, C
++
’s facilities for defining families of types and functions. It demon-
strates the basic techniques used to provide containers, such as lists, and to support generic pro-
gramming. Chapter 14 presents exception handling, discusses techniques for error handling, and
presents strategies for fault tolerance. I assume that you either aren’t well acquainted with object-
oriented programming and generic programming or could benefit from an explanation of how the
main abstraction techniques are supported by C
++
. Thus, I don’t just present the language features
supporting the abstraction techniques; I also explain the techniques themselves. Part IV goes fur-
ther in this direction.
Part III presents the C
++
standard library. The aim is to provide an understanding of how to use
the library, to demonstrate general design and programming techniques, and to show how to extend
the library. The library provides containers (such as l li is st t, v ve ec ct to or r, and m ma ap p; Chapter 16, Chapter 17),
standard algorithms (such as s so or rt t, f fi in nd d, and m me er rg ge e; Chapter 18, Chapter 19), strings (Chapter 20),
Input/Output (Chapter 21), and support for numerical computation (Chapter 22).
Part IV discusses issues that arise when C
++
is used in the design and implementation of large
software systems. Chapter 23 concentrates on design and management issues. Chapter 24 discusses
the relation between the C
++
programming language and design issues. Chapter 25 presents some
ways of using classes in design.
Appendix A is C
++
’s grammar, with a few annotations. Appendix B discusses the relation
between C and C
++
and between Standard C
++
(also called ISO C
++
and ANSI C
++
) and the ver-
sions of C
++
that preceded it. Appendix C presents some language-technical examples. Appendix
D explains the standard library’s facilities supporting internationalization. Appendix E discusses
the exception-safety guarantees and requirements of the standard library.
The C++ Programming Language, Special Edition by Bjarne Stroustrup. Copyright 2000 by AT&T.
Published by Addison Wesley, Inc. ISBN 0-201-70073-5. All rights reserved.