[ Team LiB ] |
![]() ![]() |
AcknowledgmentsEditors often get short shrift in a book's acknowledgments, sometimes receiving only a token "… and I also thank my editor, who surely must have been doing something while I was slaving over the manuscript." Debbie Lafferty, my editor, is responsible for the existence of this book. When I came to her with a mediocre proposal for a mediocre introductory programming text, she instead suggested expanding a section on gotchas into a book. I refused. She persisted. She won. Fortunately, Debbie is gracious in victory, and she has yet to utter an editorial "We told you so." Additionally, she surely must have been doing something while I slaved over the manuscript. I would also like to thank the reviewers who lent their time and expertise to help make this a better book. Reviewing an unpolished manuscript is a time-consuming, often tedious, sometimes irritating, and nearly thankless task of professional courtesy (see Gotcha #12), and the reviewers' insightful and incisive comments were much appreciated. Steve Clamage, Thomas Gschwind, Brian Kernighan, Patrick McKillen, Jeffrey Oldham, Dan Saks, Matthew Wilson, and Leor Zolman contributed advice on technical issues and social propriety, corrections, code snippets, and an occasional snide remark. Leor started review long before the manuscript was written, by sending me barbed comments on Web postings that were early versions of some of the gotchas appearing in this book. Sarah Hewins, my best friend and severest critic, earned both titles while reviewing various versions of the manuscript. David R. Dewhurst frequently put the entire project into perspective. Greg Comeau lent use of his marvelously standard C++ compiler for checking the code. Like any nontrivial work about C++, this book is an amalgam of the work of many people. Over the years, many of my students, clients, and colleagues have augmented my unhappy facility for stumbling across C++ gotchas, and many of them have helped find solutions for them. While most of these contributions can no longer be acknowledged explicitly, it is possible to acknowledge more direct contributions: The Select template of Gotcha #11 and the OpNewCreator policy of Gotcha #70 appear in Andrei Alexandrescu's Modern C++ Design. I first encountered the problem of returning a reference to constant argument, described in Gotcha #44, in Cline et al.'s C++ FAQs (it began to appear in my clients' code immediately thereafter). Cline et al. also describe the technique mentioned in Gotcha #73 for circumventing overloaded virtual functions. The Cptr template of Gotcha #83 is a modified version of the CountedPtr template that appeared in Nicolai Josuttis's The C++ Standard Library. Scott Meyers has more to say about the improper overloading of operators &&, ||, and ,, described in Gotcha #14, in his More Effective C++. He describes in more detail the necessity of value return from a binary operator, as discussed in Gotcha #58, in Effective C++ and describes the improper use of auto_ptr, treated in Gotcha #68, in Effective STL. The technique, mentioned in Gotcha #87, of returning a const from postfix increment and decrement operators is described in his More Effective C++. Dan Saks presented the first cogent arguments I had heard for the forward declaration file approach described in Gotcha #8; he was also the first to identify the "Sergeant operator" of Gotcha #17, and he convinced me not to range-check increment and decrement on enum types, mentioned in Gotcha #87. Herb Sutter's More Exceptional C++, Item 36, caused me to reread section 8.5 of the standard and update my understanding of formal argument initialization (see Gotcha #57). Some of the material of Gotchas #10, #27, #32, #33, #38–#41, #70, #72–#74, #89, #90, #98, and #99 appeared in my "Common Knowledge" column that ran initially in C++ Report and later in The C/C++ Users Journal. |
[ Team LiB ] |
![]() ![]() |