|
T
he
standard C++ library is an integral part of the C++ programming language
as defined by the ISO/ANSI standard since 1998. Naturally, every C++ programmer
needs to master this part of the language in addition to the language features
of C++. For this reason,
The Standard C++ Library
is of interest
to C++ programmers who want a comprehensive reference of the library classes.
These days, every C++ textbook that
claims to be up to date includes an introduction to the standard library.
These introductions vary in their degree of completeness, but typically
they are tutorials that try to explain those parts of the library that
are most frequently used and therefore relevant even to language novices.
The
Standard C++ Library
takes a different approach: it is devoted exclusively
to the standard C++ library and provides a tutorial and reference to all
its parts.
Indeed, the book's strength is its
scope. It mentions all classes and functions of the library from the STL
and its containers, iterators, functors, and algorithms over strings, numerics,
IOStreams, and locales, to standard exceptions, auto_pointer, and allocators.
Even details such as the rebind class template in allocators or the auto_ptr_ref
conversions in auto_pointer are mentioned at least briefly.
All relevant features are well explained
in a tutorial manner, usually accompanied by short examples that demonstrate
a typical usage. This is ideal for people who prefer learning by example
rather than by principle. The examples give you an idea of the interface
quickly without having to read much text. You might get the most out of
The
Standard C++ Library
if you use it as a reference. It is also a tutorial,
but as a tutorial it has a great deal of overlap with the introductions
that you can find in other C++ textbooks.
Still, it is disappointing that a
title devoted exclusively to the library spends little time explaining
it as the framework that it is. The standard C++ library is not only a
box of ready-to-use classes and functions; it is a framework designed to
be extended by user-defined abstractions. To use the library is to extend
it. The few examples of user-defined extensions to the library are simple
and do not exploit the full power of the library framework.
The author offers little guidance
in how you implement your own abstractions. What is recommendable? What
should be avoided? Why and when must the difference_type of a user-defined
iterator void or ptr_diff or anything else? In practice, what is a reasonable
policy for error indication in iostream operations? These and other questions
remain unanswered. In fairness, it must be said that hardly any C++ title
covers this ground.
The Standard C++ Library
,
as a tutorial, is good for programmers with a working knowledge of C++
who intend to use the prefabricated abstractions offered in the library
and aim to add simple extensions. As a reference to the library it is excellent,
impressive by detail and scope, readable and well-organized, and clearly
goes beyond what you typically find in C++ textbooks.
Angelika Langer
develops
and teaches classes on advanced C++, STL, multithreading, internationalization,
and Java. She has served on the ANSI/ISO C++ Committee since 1993.
Klaus
Kreft
is a software architect and consultant with more than a decade
of experience in industrial software development. He works for Siemens
Business Services in Germany. Langer and Kreft are working on a book about
standard C++ IOStreams and locales and are columnists for
C++
Report
.
|