4830380
9780321412997
He who has begun has half done. Dare to be wise; begin! Epistles, I, ii, Horace This book is for C++ programmers who are frustrated with some of the limitations of the standard C++ library. The book is a tutorial and reference for the library described in the first C++ Library Technical Report, which was approved in 2006 by the International Organization for Standardization (ISO). 1 This library, which I'll call the TR1 library, isn't part of the C++ Standard. The TR is only "an informative document," but you can expect to see the library shipped with some compilers and provided as an add-on library from various library vendors. You can also expect to see many of its components incorporated into the standard library in the next C++ standard. 2 The TR1 library extends the standard C++ library with new facilities in several areas: Utilities:a reference-counted smart pointer; a class template tuple that generalizes the std::pair class template to handle various numbers of arguments Containers:sets and maps implemented with hash tables; a fixed-size array Call wrappers:more powerful and more flexible templates that provide wrappers around functions, member functions, and other function objects, allowing them to be used more easily as arguments to algorithms Type traits:a set of templates that extract properties of types or modify types at compile time, simplifying template metaprogramming Numerics:a rich set of random number generators; advanced mathematical special functions; numeric facilities like those added to the C language in 1999 Regular expressions:classes and functions to describe and search for patterns in text C compatibility:types, functions, and macros like those added to the C language in 1995 and 1999 Formal work on the TR1 library began in 2001, when the C++ Standards Committee, through its Library Working Group, asked for proposals. Most of the proposals that made it into the library came from members of Boost, 3 an organization set up in 1998 by Standards Committee members who were looking for a way to develop new libraries without the constraints imposed by the process of standardization. The added flexibility from working outside that formal process made it possible to develop the pieces of the Boost libraries on independent schedules far more rapidly than is possible within a standards committee. Boost is a thriving organization, and its library has many useful things that are not in the TR1 library. The Standards Committee meets twice a year. From 2001 to 2005, the Library Working Group spent most of its time at those meetings, as well as a great deal of e-mail time between meetings, working on the TR1 library. During that time, the working group refined the proposals it had received: simplifying where appropriate, rewriting both for clarity and for the formalism required in an ISO standard, and unifying the presentation of the pieces of the library. Toward the end of 2002, the company I worked for, Dinkumware, Ltd., began implementing the TR1 library. Dinkumware sells standard libraries for C, C++, and Java, so this was a natural step for us. Our work also helped improve the Technical Report, as we found things that were vaguely described, overspecified, or simply missing. 4 Dinkumware has a complete implementation of the TR1 library, and I've used it in all the examples in this book. About This Book This book is divided into seven parts, each one covering one area of the new facilities. Each part begins with an overview of those facilities. The overview usually includes some remarks about their history and, in some cases, reasons why some obvious features are not in the TR1 library. Each part hasBecker, Pete is the author of 'C++ Standard Library Extensions A Tutorial And Reference', published 2006 under ISBN 9780321412997 and ISBN 0321412990.
[read more]