EC++ CD: Book's Index Books' Index This index contains the index entries from Effective C++ and More Effective C++. It has no information about the CD's magazine articles, nor does it cover CD-specific pages like the Introduction. To perform a comprehensive search of everything on the CD, use the search applet. Within the index, page numbers corresponding to Effective C++ are preceded by an E. Those corresponding to More Effective C++ are preceded by an M. Hence, E126 means page 126 of Effective C++, and M15 means page 15 not Item 15! of More Effective C++. Example classes and class templates used in the books are indexed under example classes/templates. Example function and function templates are indexed under example functions/templates. Many example uses of new and lesser-known language features are indexed under example uses. In this index, the term definition refers to a C++ definition. English definitions definitions of terms are labeled "definition (English)" and are summarized under English definitions. Before A #define M294 .cpp files E138 ?:, vs. if/then M56 __cplusplus M273 ">>", vs. "> >" M29 0, see zero 1066 E154 80-20 rule E143, E168, M79, M82-M85, M106 90-10 rule Mxi, M82 A abort E26 assert and M167 object destruction and M72 relationship to terminateM72 violated exception specifications and E28 abstract classes E161, E201 definition (English) E63 drawing M5 identifying M267, M268 inheritance and M258, M270 transforming from concrete M266-M269 abstract mixin base classes M154 abstractions functional E89-E90 identifying M267, M268 useful M267 access-declarations M144 accessibility control over data members' E89 restrictions handles and E124 inheritance and E115 Ada E57, E224 adding data and functions to classes at runtime M287 address comparisons to determine object locations M150-M152 address equality E75 addresses, of inline functions E140 address-of operator, see operator& adjacent differences E231 Advanced C++: Programming Styles and Idioms Exvii, Exviii, M287 Adventure, allusion to M271 Afshar, Jamshid Mxii algorithms, in standard C++ library E229 aliasing E52, E53, E75-E76, E101 definition (English) E72 Alice's Restaurant, allusion to E43 allocation, see memory management, operator new, memory allocation allocators E227 ambiguity deliberately introducing E111 diamonds and E200 libraries and E114 MI and E114-E115, E195, E200 potential E113-E116 type conversions and E113-E114 American National Standards Institute (ANSI) E234 amortizing computational costs M93-M98 Annotated C++ Reference Manual, The, see ARM ANSI/ISO standardization committee, see ISO/ANSI standardization committee APL M92 application framework M234 approximating see also enum hack bool E10,M3-M4 C++-style casts M15-M16 const static data members M141 explicit M29-M31 in-class using declarations M144 mutable M89-M90 namespaces E119-E122 virtual functions M121 vtbls M235-M251 Arbiter, Petronius Ei ARM (The Annotated C++ Reference Manual) Exvii, E61, E138, E195, E196, E235-E236, Mxii, M277, M285 array new E36, M42 arrays associative M236, M237 auto_ptr and M48 default constructors and M19-M21 dynamic M96, M98 inheritance and M17-M18 memory allocation for M42-M43 multi-dimensional M213-M217 of objects with constructors E5-E6 of pointers to functions M15, M113 of pointers, as substitute for arrays of objects M20 pointer arithmetic and M17 pointers into M280 using placement new to initialize M20-M21 ASPECT_RATIO E13-E14 E26 assert macro E26 abort and M167 NDEBUG and E26 assignment arrays and E81 in reference-counted value classes M196 mixed-type M260, M261, M263-M265 of members, see member assignment of pointers and references M11 operator, see operator= partial M259-M263, M265 prohibiting E52 through pointers M259, M260 to base part of object E69-E70 to self E71-E73 vs. initialization E8-E9, E136 associative arrays M236, M237 author, contacting Exv, M8 auto_ptr E25, M49, M53, M57, M58, M137, M139, M162, M240, M257 assignment of M162-M165 copying of M162-M165 heap arrays and M48 implementation M291-M294 object ownership and M183 pass-by-reference and M165 pass-by-value and M164 preventing resource leaks and M48, M58 automatically generated functions E212-E216 Avery, Katrina Mxiii B bad_alloc class M70, M75 bad_cast class M70, M261, M262 bad_exception class M70, M77 bad_typeid class M70 Barry, Dave, allusion to Exix, E234 Barton, John J. M288 base classes see also inheritance catch clauses and M67 constructor arguments E200 delete and M18 derived operator= and E69-E70 for counting objects M141-M145 initialization order E58 initialization when virtual E200 meaning when common E210 nonvirtual E200 virtual, see virtual base classes BASIC M156, M213 basic_ostream template E226, E227 basic_string class M279, M280 Battle of Hastings E154 Beauchaine, Bob Mxiii Becker, Pete Exviii begin function M283 behavior undefined, see undefined behavior customization via virtual functions E206-E207 benchmarks M80, M110, M111 Bengtsson, Johan Exix Bern, David Exviii, Exix Besaw, Jayni Mxv best fit M67 Bible, allusion to M235 binary upgradeability, inlining and E142 binding dynamic, see dynamic binding static, see static binding birds and penguins E156-E158 bitset template E229, M4, M283 bitwise const member functions E94 bitwise copy during assignment E50, E213 during copy construction E51, E213 Blankenbaker, Paul Exix bloated code, due to templates E190 block-local variables, defining E135-E137 Body classes, see Handle/Body classes books see also recommended books Advanced C++: Programming Styles and Idioms Exvii, Exviii, M287 ARM, The, see ARM C Programming Language, The Exviii, M36 C++ Programming Language, The Exvii, M286 C++ Programming Style Exviii, M287 C++ Strategies and Tactics Exviii, Mxiii Computer Architecture: A Quantitative Approach Mxi Design and Evolution of C++, The E234, Mxiii, M278, M285 Design Patterns CD: Elements of Reusable Object-Oriented Software M289 Design Patterns: Elements of Reusable Object-Oriented Software M288 Designing and Coding Reusable C++ Exviii, M288 Effective C++ Mxii, M5, M100, M286 International Standard for Information Systems Programming Language C++ E234 Large-Scale C++ Software Design Exviii More Effective C++ E237-E238 Scientific and Engineering C++ M288 Some Must Watch While Some Must Sleep E154 Taligent's Guide to Designing Programs Exviii, Mxii bool E9, M3, M4 approximating E10 Bosch, Derek Exix boss, pointy-haired E187 Box, Don Mxii, Mxiii Braunegg, David Exix Brazile, Robert Exix breakpoints, and inlining E142 buffering, in iostreams E229 bugs in Effective C++, reporting Exv bugs in More Effective C++, reporting M8 Burkett, Steve Exviii, Mxiii Buroff, Steven Mxii butterfly effect, the E221 bypassing constructors M21 exception-related costs M79 RTTI information M122 smart pointer smartness M171 strong typing M287 virtual base classes M122 virtual functions M122 C C dynamic memory allocation M275 functions and name mangling M271 headers, in standard C++ library E225 linkage M272 migrating to C++ M286 mixing with C++ M270-M276 standard library M278 C Programming Language, The Exviii, M36 C-style casts M12, M90 C style comments, vs C++ style E21 C Users Journal Mxiii C++ dynamic memory allocation M275 migrating from C M286 mixing with C M270-M276 standard library, see standard C++ library C++ Programming Language, The Exvii, M286 C++ Programming Style Exviii, M287 C++ Report Exvii, Exviii, Mxii, Mxiii, Mxv, M287, M289 C++ Strategies and Tactics Exviii, Mxiii C++ style comments, vs. C style E21 C++-style casts M12-M16 approximating M15-M16 C, Objective E195 C, used in Effective C++ E12 C/C++ Users Journal Exviii, Mxiii, M289 c_str M27 caching M94-M95, M98 hit rate, inlining and E137 callback functions M74-M75, M79 calls to functions, see function calls Candide, allusion to M19 Cargill, Tom Exviii, Exix, Mxii, Mxiii, Mxv, M44 Carolan, John Exviii Carroll, Glenn Exix Carroll, Martin Exviii, M288 Casablanca, allusion to E96 E26 casts advantages of new vs. old forms E10 C++-style M12-M16 C-style M12, M90 downcasts E176 new forms for E10-E11 of function pointers M15, M242 safe M14 temptations of E175 to references E70 to remove constness or volatileness E96-E97, E124, M13, M221 catch M56 see also pass-by-value, pass-by-reference, pass-by-pointer by pointer M70 by reference M71 by value M70 clauses, order of examination M67-M68 clauses, vs. virtual functions M67 inheritance and M67 temporary objects and M65 cerr E226 change, designing for M252-M270 changes in second edition of Effective C++ Exiv-Exv chaos theory E221 Chappell, Tom Exviii char*s, vs. string classes E8, M4 characters Unicode M279 wide M279 Cheshire Cat classes E146-E149 Chisholm, Paul Exix cin E226 clairvoyance, and MI E199 Clamage, Steve Exvii, Exviii, Exix, Mxii, Mxiii, Mxiv Clancy, see Urbano, Nancy L. Claris, a guy at Exviii class definitions compilation dependencies and E147 object sizes and E145 vs. class declarations E147 classes see also class definitions, interfaces abstract E63, E161, M154 drawing M5 adding members at runtime M287 base, see base classes Body E146-E149 Cheshire Cat E146-E149 concrete, drawing M5 constants within E14-E15 declaring E4 vs. defining E147 defining E5 derived, see derived classes designing, see design diagnostic, in the standard library M66 Envelope/Letter E146-E149 extent E59 for collections E191 for registering things M250 for type-safe interfaces E192 Handle/Body E146-E149 hiding implementations E146-E152 influence of type on behavior E186 initialization order E58 interface, efficiency of E194 meaning of no virtual functions E61 members, see members mixin M154 modifying, and recompilation M234, M249 nested, and inheritance M197 nested, examples E186, E218 Protocol E149-E152, E173, E201 proxy, see proxy classes sharing common features E208 specification, see interfaces templates for, specializing M175 transforming concrete into abstract M266-M269 unnamed, compiler diagnostics and E112 virtual base, see virtual base classes class-specific constants E14-E15 cleaning your room M85 cleverness in the standard C++ library E108 client, definition E9, M7 CLOS E195, M230 COBOL E113, M213, M272 code amazing E194 bloat, due to templates E190 generalizing M258 incorrect, efficiency and E101, E124, E129, E131 replication M47, M54, M142, M204, M223, M224 avoiding E109, E191-E193 un-inlined inline functions and E139 reuse E202 poor design and E206-E209 via smart pointer templates and base classes M211 via the standard library M5 size, with inline functions E137 Cok, David Mxii collections, based on pointers E191 Colvin, Gregory Mxiii combining free with delete E20 public and private inheritance E201-E205 comma operator, see operator, comments #define and E21 C style vs. C++ style E21 eliminating E137 within comments E21 committee for C++ standardization, see ISO/ANSI standardization committee common base classes, meaning of E210 features, inheritance and E164, E208 comp.lang.c++Exviii, Mxi, Mxii, Mxiii, M289 comp.lang.c++.moderated M289 comp.std.c++ Mxi, M290 comparing addresses to determine object location M150-M152 compatibility with C, as C++ design goal E233 with other languages, vptrs and E61 compilation dependencies class definitions and E147 minimizing E143-E152 pointers, references, and objects and E147 compilers diagnostics for unnamed classes E112 lying to M241 warnings from E223-E224 compile-time errors E110 benefits of E219 vs. runtime errors E216 complete interfaces E79, E184 complex numbers M279, M280 E225 complex template E226, E231 E225 complexities of multiple inheritance E195-E201 of virtual base classes E201 composition, see layering Computer Architecture: A Quantitative Approach Mxi conceptually const member functions E95-E97 concrete classes drawing M5 inheritance and M258-M270 transforming into abstract M266-M269 concurrency E225 conditionals and switches vs. virtual functions E176 consistency among +, =, and +=, etc. M107 between built-in and user-defined types M254 between prefix and postfix operator++ and operator-- M34 between real and virtual copy constructors M126 public interfaces and E89 with the built-in types E66, E78, E82, E92 const E91-E97 bitwise E94 casting away E96-E97, E124 conceptual E95-E97 data members E53-E54 in function declarations E92-E97 member functions E92-E97, M89, M160, M218 handles and E128 members, in-class initialization of E14 overloading on E92-E93 pointers E91, E121 return types M33-M34, M101 return value E92, E125 static data members, initialization M140 uses E91 vs. #define E13-E14 const_cast E10, M13, M14, M15, M37, M90 example use E96, E97, E124 const_iterator type M127, M283 constant pointers M55-M56 constants E14 see also const class-specific E14-E15 constness, casting away M13, M221 constructing objects on top of one another M287 construction of local objects E131 phases of E54 with vs. without arguments E136 constructors E77 see also construction arrays of objects and E5-E6 as type conversion functions M27-M31 bypassing M21 calling directly M39 copy, see copy constructors default, see default constructors empty, illusion of E141 explicit E67, E85, M28-M31, M227, M294 fully constructed objects and M52 implicitly generated E212 inlining and E140-E142 lazy M88-M90 malloc and E19-E20, M39 manual invocation of E141 memory leaks and M6 object definitions and E135 operator new and E141, M39, M149-M150 operator new[] and M43 passing arguments E200 preventing exception-related resource leaks M50-M58 private E218, M130, M137, M146 protected M142 pseudo, see pseudo-constructors purpose M21 references and M165 relationship to new operator and operator new E23, M40 single-argument M25, M27-M31, M177 static initialization and M273 static member initialization and E57, E58 structs and E186 virtual, see virtual constructors contacting the author Exv, M8 containers, see standard C++ library containment, see layering contexts for object construction M136 control over data members' accessibility E89 conventions for I/O operators M128 for names E11, E138, E144 in the STL E232, M284 used in More Effective C++ M5-M8 conversion functions, see type conversion functions conversions, see type conversions Coplien, Jim Exvii, Exviii, M287 copy algorithm E230 copy construction, prohibiting E52 copy constructors E6, E109, M146 bitwise copy and E51, E213 classes with pointers and M200 default definition E213 exceptions and M63, M68 for strings M86 implicitly generated E212 inheritance and E71 memberwise copy E213 motivation for making private E52 non-const parameters and M165 pass-by-value and E6, E77, E98-E99 pointer members and E51-E52 rationale for default behavior E233 return-by-value and E6 smart pointers and M205 virtual, see virtual copy constructors copying objects exceptions and M68 static type vs. dynamic type M63 when throwing an exception M62-M63 copy-on-write M190-M194 Corbin, David Exix correctness, assignment to self and E72 costs see also efficiency, optimization assignment vs. construction and destruction E105 of Handle classes E151 of initialization vs. assignment E55 of inline functions that aren't E139 of minimizing compilation dependencies E151 of nonminimal interfaces E80 of pass-by-value E98-E99 of Protocol classes E151 of unused objects E135 of virtual base classes E198, E118-E120 count_if algorithm E230 counting objects E59, M141-M145 cout E226 cows, coming home E143 E225, E226 E127 E225, E226 C-style casts M12 ctor, definition M6 custom memory management see memory management customizations via virtual functions E206-E207 D D&E E234 data members adding at runtime M287 auto_ptr M58 control over accessibility E89 default assignment E213 default initialization E213 initialization vs. assignment E53-E57 initialization when const M55-M56 initialization when static M140 replication, under multiple inheritance M118-M120 static, in templates M144 virtual base classes and E200 dataflow languages M93 Davis, Bette, allusion to M230 Davis, Tony Exix, Mxiii Dawley, Kim Exx, Mxiv DBL_MIN E107 deallocation, see memory management, operator delete debuggers #define and E14 inline functions and E142 declarations E4 of classes E4 of functions E4 of objects E4 of templates E4 replacing definitions E147 decoupling interfaces and implementations E146-E152 decrement operator, see operator-- default construction avoiding when unneeded E137 vs. construction with arguments E136 default constructors E5, E109 arrays and M19-M21 definition M19 implicitly generated E212 meaningless M23 restrictions from M19-M22 templates and M22 virtual base classes and M22 when to/not to declare M19 default implementations for virtual functions, danger of E163-E167 of copy constructor E213 of operator= E213 default parameters E171-E173 operator new and E39 static binding of E173 vs. overloading E106-E109 #define comments and E21 debuggers and E14 disadvantages of E14, E16 vs. const E13-E14 vs. inline functions E15-E16 defining objects E135-E137 variables E135-E137 in if statements E181 definitions E4 deliberate omission of E116 for implicitly generated functions E213 for pure virtual functions E162, E166-E167 for static class members E29 of classes E5 of functions E4 of objects E4 of templates E5 replacing with declarations E147 delete see also delete operator, operator delete, ownership combining with free E20 communication with new E40 consistency with new E43 deleted pointer and E52 determining when valid M152-M157 example implementation E44 inheritance and M18 memory not from new and M21 nonvirtual destructors and M256 null pointers and E25, M52 objects and M173 operator delete and E23 relationship to destructors E23, E59-E63 smart pointers and M173 this and M145, M152, M157, M197, M213 delete operator M37, M41, M173 operator delete[] and destructors and M43 placement new and M42 this and M145, M152, M157, M197, M213 deletion virtual destructors and E59-E63 deliberately introducing ambiguity E111 delimiters, field, implementing via virtual functions E202 Dement, William E154 deprecated features M7 access declarators M144 conversion from const char* to char* E91 old C++ .h headers E225 statics at file scope M246 strstream class M279 deque template E229, M283 derived classes catch clauses and M67 delete and M18 hiding names in base classes E224, E235 implementing destructors in E141 operator= and E69-E70, M263 prohibiting M137 design contradiction in E170 for change M252-M270 multiple dispatch and M235 object-oriented E153-E211 of function locations M244 of libraries M110, M113, M284, M288 of templates M286 of types and classes E77-E78, M33, M133, M186, M227, M258, M268 of virtual function implementation M248 patterns M123, M288 poor, and code reuse E206-E209 poor, and MI E205-E209 Design and Evolution of C++, The E234, Mxiii, M278, M285 design goals, for C++ E232 Design Patterns CD: Elements of Reusable Object-Oriented Software M289 Design Patterns: Elements of Reusable Object-Oriented Software M288 Designing and Coding Reusable C++ Exviii, M288 destruction, static M273-M275 destructors E77 delete and M256 exceptions and M45 free and E19-E20 fully constructed objects and M52 inlining and E140-E142 local objects and E131 longjmp and M47 memory leaks and M6 multiple pointers and E191 nonvirtual E81 object deletion and E59-E63 operator delete[] and M43 partially constructed objects and M53 possible implementation in derived classes E141 private M145 protected M142, M147 pseudo M145, M146 pure virtual E63, M195, M265 relationship to delete E23 smart pointers and M205 virtual M143, M254-M257 behavior of E61 object deletion and E59-E63 determining whether a pointer can be deleted M152-M157 whether an object is on the heap M147-M157 diagnostics classes of the standard C++ library M66 diamonds, see multiple inheritance differences between first and second editions of Effective C++ Exiv-Exv Dilbert E187 dispatching, see multiple dispatch distinguishing lvalue and rvalue use of operator[] M87, M217-M223 domain_error class M66 dominance E200 double application of increment and decrement M33 double-dispatch, see multiple dispatch downcasting E176-E181, E196 definition (English) E176 eliminating E179 safe E179-E181 use with read-only libraries E179 vs. virtual functions E180 dtor, definition M6 Duby, Carolyn Mxiii dumb pointers M159, M207 duplication of code, see replication of code dynamic arrays M96-M98 dynamic binding definition (English) E172 of virtual functions E170 dynamic type definition (English) E172 vs. static type M5-M6 vs. static type, when copying M63 dynamic_cast E10, E179-E181, M6, M37, M261-M262 approximating M16 example use E180, E181, M156 meaning M14 null pointer and M70 to get a pointer to the beginning of an object M155 to reference, failed M70 to void* M156 virtual functions and M14, M156 E eager evaluation M86, M91, M92, M98 converting to lazy evaluation M93 Eastman, Roger Exix Eckel, Bruce Mxiii Edelson, Daniel Mxii, M179 Effective C++ Mxii, M5, M100, M286 vs. More Effective C++ E237 Web site for Exvi efficiency see also costs, compilation dependencies, optimization as C++ design goal E233 assigning smart pointers and M163 assignment to self and E72 assignment vs. construction and destruction E105 benchmarks and M110 binding default parameter values and E173 caching and E90, M94-M95, M98 class statics vs. function statics M133 constructors and destructors and M53 copying smart pointers and M163 cost amortization M93-M98 custom memory management and E43 encapsulation and M82 function return values and M101 implications of meaningless default constructors M23 incorrect code and E101, E105, E124, E129, E131 initialization vs. assignment E54 initialization with vs. without arguments and E136 inlining and M129 iostreams vs. stdio E18, M110-M112 language rules and E233 libraries and M110, M113 locating bottlenecks M83 macros vs. inline functions E16 maintenance and M91 manual methods vs. language features M122 member initialization/finalization order and E58 memory allocation routines and E39 multiple inheritance and M118, M120 object size and M98 of allocation for small objects E39-E48 of exception-related features M64, M70, M78-M80 of initializing static members in constructors E57 of interface classes E194 of numeric_limits E107 of prefix vs. postfix increment and decrement M34 of stand-alone operators vs. assignment versions M108 of standard strings E229 operators new and delete and M97, M113 paging behavior and M98 pass-by-pointer and M65 pass-by-reference and E99, M65 pass-by-value and E98-E99, M65 passing built-in types and E101 prefetching M96-M98 profiling and M84-M85, M93 reading vs. writing reference-counted objects M87, M217 reference counting and E52, E229, M183, M211 returning pointers/references to class members and E131 runtime checks and E216 space penalty of MI E199 space vs. time M98 summary of costs of various language features M121 system calls and M97 temporary objects and M99-M101 tracking heap allocations and M153 unused objects and E135 virtual functions and E168, M113-M118 virtual functions vs. manual methods M121, M235 vptrs and M116, M256 vs. minimalness in class interfaces E80 vs. syntactic convenience M108 vtbls and M114, M256 Eiffel E146, E195 80-20 rule E143, E168 Einstein, Albert E101 Ellis, Margaret Exviii, E235, Mxii, M285, M288 email address for the author Exv, M8 embedding, see layering emulating features, see approximating encapsulation allowing class implementations to change M207 efficiency and M82 end function M283 English definitions of aliasing E72 of Body class E148 of Cheshire Cat class E148 of client E9, M7 of downcast E176 of dynamic binding E172 of dynamic type E172 of Envelope class E148 of Handle class E148 of has-a relationship E182 of integral types E15 of isa relationship E155 of is-implemented-in-terms-of relationship E183 of layering E182 of Letter class E148 of local static objects E222 of MI E194 of non-local static objects E221 of Protocol class E149 of static type E171 of translation unit E220 enum hack E15 enums overloading operators and M277 Envelope/Letter classes E146-E149 equal algorithm E230 equality, see object equality errata list, on-line for Effective C++ Exvi for More Effective C++ M8 errors benefits of compile-time detection E219 compile-time E110 vs. runtime E216 detected during linking E14, E64, E117, E139, E219 library support for E231 link-time vs. runtime E216 off-by-one E83 runtime E110, E157 evaluation converting eager to lazy M93 eager M86, M91, M92, M98 lazy M85-M93, M94, M98, M191, M219 over-eager M94-M98 short-circuit M35, M36 Eve E176 example classes/templates A E5, E113, E198 AbstractAnimal M264 AccessLevels E89 Address E129, E182 Airplane E39, E41, E44, E47, E163, E164, E166 AirplaneRep E39 Airport E163 ALA M46 Animal M258, M259, M263, M265 Array E57, E62, E81, E116, M22, M27, M29, M30, M225 Array::ArraySize M30 Array::Proxy M225 Array2D M214, M215, M216 Array2D::Array1D M216 Asset M147, M152, M156, M158 Asteroid M229 AudioClip M50 AuxGraphicalObject E196 AuxLottery E196 AWOV E63 B E5, E113, E169, E198, E224, M255 BalancedBST M16 BankAccount E174, E177, E178, E180 Base E35, E37, E69, E71, E75, E140, E235 Base1 E114, E115 Base2 E114, E115 Bird E156, E158 BookEntry M51, M54, M55, M56, M57 BritishShortHairedTabby E188 BST M16 C E6, E75, E198 C1 M114 C2 M114 CallBack M74 CantBeInstantiated M130 CartoonCharacter E205, E208 Cassette M174 CasSingle M178 Cat E188 CatStack E192, E193 CD M174 CheckingAccount E176, E177, E178, E180 Chicken M259, M260, M263, M265 Circle E172 Clock E5 CollisionMap M249 CollisionWithUnknownObject M231 ColorPrinter M136 Complex E101 Counted M142 CPFMachine M136 Cricket E206, E207, E208 D E169, E198, E224, M255 DatabaseID E204 DataCollection M94 Date E217, E218 Date::Month E218 DBPtr M160, M171 Derived E35, E69, E71, E76, E114, E115, E140, E235, E236 Directory E220, E222 DynArray M96 Ellipse E161 Empty E212 EnemyTank E60 EnemyTarget E59 EngineeringConstants E15 EquipmentPiece M19, M23 FileSystem E220 FlyingBird E156 FSA M137 GameObject M229, M230, M233, M235, M242 GamePlayer E14, E15 GenericStack E193 Graphic M124, M126, M128, M129 GraphicalObject E195 Grasshopper E206, E207, E208 HeapTracked M154 HeapTracked::MissingAddress M154 Image M50 Insect E208 InterestBearingAccount E177 IntStack E192, E193 Kitten M46 LargeObject M87, M88, M89 Lizard M259, M260, M262, M263, M265 LogEntry M161 Lottery E195 LotterySimulation E195, E197 ManyDataMbrs E55, E56 Matrix M90 ModelA E163, E165, E166 ModelB E163, E165, E166 ModelC E164, E165, E167 Month E218 MusicProduct M173 MyPerson E205 Name M25 NamedArray E62 NamedObject E214, E215 NamedPtr E53, E54, E68 Natural E109 NewHandlerSupport E32 NewsLetter M124, M125, M127 NLComponent M124, M126, M128, M129 NonFlyingBird E157, E158 NonNegativeUPNumber M146, M147, M158 NullClass E111 Penguin E156, E157, E158 Person E98, E129, E130, E143, E144, E145, E146, E149, E150, E155, E174, E182, E189, E201, E204 PersonImpl E146 PersonInfo E202, E204 PhoneNumber E182, M50 Point E61 Pool E46 Printer M130, M132, M135, M138, M140, M141, M143, M144 Printer::TooManyObjects M135, M138, M140 PrintingStuff::Printer M132 PrintJob M130, M131 Puppy M46 Rational E18, E84, E86, E101, E132, M6, M25, M26, M102, M107, M225 RCIPtr M209 RCObject M194, M204 RCPtr M199, M203 RCWidget M210 RealPerson E150 Rectangle E159, E161, E171 RegisterCollisionFunction M250 Satellite M251 SavingsAccount E174, E177, E178, E180 sdm::Handle E118, E120 sdmHandle E117 Session M59, M77 Set E183, E184 Shape E161, E171 Siamese E188 SmartPointer E5 SmartPtr M160, M168, M169, M176, M178, M181 SmartPtr M175 SmartPtr M175 SmartPtrToConst M181 SpaceShip M229, M230, M233, M235, M236, M238, M239, M240, M243 SpaceStation M229 SpecialLotterySimulation E196 SpecialWidget M13, M63 SpecialWindow M269 SpeedDataCollection E90 Square E159 Stack E186, E187, E188, E194 Stack::StackNode E186 String E6, E49, E72, E87, E93, E94, E95, E96, E124, E126, M85, M183, M186, M187, M188, M189, M190, M193, M197, M198, M201, M204, M218, M219, M224 String::CharProxy M219, M224 String::SpecialStringValue M201 String::StringValue M186, M193, M197, M201, M204 Student E98, E155, E189 TextBlock M124, M126, M128, M129 Tuple M161, M170 TupleAccessors M172 TVStation M226 UnexpectedException M76 UPInt M32, M105 UPNumber M146, M147, M148, M157, M158 UPNumber::HeapConstraintViolation M148 Validation_error M70 Wacko E58 Widget E65, E91, E121, M6, M13, M40, M61, M63, M210 widgets E121 Window E100, M269 WindowHandle M49 WindowWithScrollBars E100 X E28, E29, E32, E38, E39 Y E29 example functions/templates AbstractAnimal::~AbstractAnimal M264 AbstractAnimal::operator= M264 AccessLevels::getReadOnly E89 AccessLevels::getReadWrite E89 AccessLevels::setReadOnly E89 AccessLevels::setWriteOnly E89 Airplane::defaultFly E165 Airplane::fly E163, E166 Airplane::operator delete E44, E47 Airplane::operator new E42, E47 ALA::processAdoption M46 allocateSomeObjects M151 Animal::operator= M258, M259, M263, M265 Array::Array E57, M22, M27, M29, M30 Array::ArraySize::ArraySize M30 Array::ArraySize::size M30 Array::operator[] M27 Array::Proxy::operator T M225 Array::Proxy::operator= M225 Array::Proxy::Proxy M225 Array2D::Array2D M214 Array2D::operator() M215 Array2D::operator[] M216 Asset::~Asset M147 Asset::Asset M147, M158 assignmentTester E69 asteroidShip M245 asteroidStation M245, M250 AudioClip::AudioClip M50 AuxGraphicalObject::draw E196 AuxLottery::draw E196 AWOV::AWOV E63 Base::operator delete E37 BookEntry::~BookEntry M51, M55, M58 BookEntry::BookEntry M51, M54, M55, M56, M58 BookEntry::cleanup M54, M55 BookEntry::initAudioClip M57 BookEntry::initImage M57 C1::~C1 M114 C1::C1 M114 C1::f1 M114 C1::f2 M114 C1::f3 M114 C1::f4 M114 C2::~C2 M114 C2::C2 M114 C2::f1 M114 C2::f5 M114 CallBack::CallBack M74 CallBack::makeCallBack M74 callBackFcn1 M75 callBackFcn2 M75 CantBeInstantiated::CantBeInstantiated M130 Cassette::Cassette M174 Cassette::displayTitle M174 Cassette::play M174 CatStack::empty E192, E193 CatStack::pop E192, E193 CatStack::push E192, E193 CD::CD M174 CD::displayTitle M174 CD::play M174 checkForCollision M229 Chicken::operator= M259, M260, M263, M265 CollisionMap::addEntry M249 CollisionMap::CollisionMap M249 CollisionMap::lookup M249 CollisionMap::removeEntry M249 CollisionMap::theCollisionMap M249 CollisionWithUnknownObject::CollisionWithUnknownObject M231 constructWidgetInBuffer M40 convertUnexpected M76 countChar M99 Counted::~Counted M142 Counted::Counted M142 Counted::init M142 Counted::objectCount M142 DataCollection::avg M94 DataCollection::max M94 DataCollection::min M94 DBPtr::DBPtr M160, M161 DBPtr::operator T* M171 deleteArray M18 Derived::operator= E69 Directory::Directory E220, E223 displayAndPlay M174, M177, M178 displayInfo M49, M50 doNothing E51 doSomething M69, M71, M72 drawLine M271, M272, M273 DynArray::operator[] M97 editTuple M161, M167 Empty::~Empty E213 Empty::Empty E213 Empty::operator& E213 encryptPassword E136 EnemyTank::~EnemyTank E60 EnemyTank::EnemyTank E60 EnemyTank::numberOfTanks E60 EnemyTarget::~EnemyTarget E59 EnemyTarget::EnemyTarget E59 EnemyTarget::numberOfTargets E59 EquipmentPiece::EquipmentPiece M19 f M3, M66 f1 M61, M73 f2 M61, M73 f3 M61 f4 M61 f5 M61 find M281, M282, M283 findCubicleNumber M95 freeShared M42 FSA::FSA M137 FSA::makeFSA M137 GameObject::collide M230, M233, M235, M242 GenericStack E191 GenericStack::StackNode::StackNode E191 Graphic::clone M126 Graphic::operator<< M128 Graphic::print M129 HeapTracked::~HeapTracked M154, M155 HeapTracked::isOnHeap M154, M155 HeapTracked::operator delete M154, M155 HeapTracked::operator new M154, M155 Image::Image M50 initializeCollisionMap M245, M246 IntStack::empty E192, E193 IntStack::push E192, E193 inventoryAsset M156 isSafeToDelete M153 Kitten::processAdoption M46 LargeObject::field1 M87, M88, M89, M90 LargeObject::field2 M87, M88 LargeObject::field3 M87, M88 LargeObject::field4 M87, M88 LargeObject::field5 M87 LargeObject::LargeObject M87, M88, M89 Lizard::operator= M259, M260, M261, M262, M263, M264, M265 LogEntry::~LogEntry M161 LogEntry::LogEntry M161 lookup M245, M247 main M111, M251, M274 makeBigger E159 makeStringPair M245, M246 mallocShared M42 ManyDataMbrs::init E56 ManyDataMbrs::ManyDataMbrs E56 max E16, E106 merge M172 ModelA::fly E165, E166 ModelB::fly E165, E166 ModelC::fly E165, E167 MusicProduct::displayTitle M173 MusicProduct::MusicProduct M173 MusicProduct::play M173 MyPerson::address E205 MyPerson::birthDate E205 MyPerson::name E205 MyPerson::nationality E205 MyPerson::valueDelimClose E205 MyPerson::valueDelimOpen E205 Name::Name M25 NamedPtr::NamedPtr E53 NamedPtr::operator= E68 Natural::init E109 Natural::Natural E109 NewsLetter::NewsLetter M125, M127 NewsLetter::readComponent M125 NLComponent::clone M126 NLComponent::operator<< M128 NLComponent::print M129 noMoreMemory E27 normalize M170 numDigits E4 onHeap M150 operator const char* E126 operator delete E37, M41, M153 operator new E30, E32, E34, E36, M38, M40, M153 operator& E213 operator* E87, E102, E105, M102, M103, M104 operator+ E7, M100, M105, M106, M107, M108, M109 operator- M107, M108 operator<< E18, E88, M129 operator= E9, E66, E73, E74, E75, M6 for derived class E70 operator== M27, M31, M73 operator>> E88, M62 passAndThrowWidget M62, M63 Person::age E143 Person::makePerson E151 Person::name E149 Person::Person E148 PersonInfo::theName E203 PersonInfo::valueDelimClose E203 PersonInfo::valueDelimOpen E203 printBSTArray M17 printDouble M10 Printer::~Printer M135, M138, M143 Printer::makePrinter M138, M139, M140, M143 Printer::performSelfTest M130, M139, M143 Printer::Printer M131, M132, M135, M139, M140, M143 Printer::reset M130, M139, M143 Printer::submitJob M130, M139, M143 Printer::thePrinter M132 PrintingStuff::Printer::performSelfTest M132 PrintingStuff::Printer::Printer M133 PrintingStuff::Printer::reset M132 PrintingStuff::Printer::submitJob M132 PrintingStuff::thePrinter M132, M133 PrintJob::PrintJob M131 printMinimumValue E107 printNameAndDisplay E100, E101 printTreeNode M164, M165 processAdoptions M46, M47, M48 processCollision M245 processInput M213, M214 processTuple M171 Puppy::processAdoption M46 rangeCheck M35 Rational::asDouble M26 Rational::denominator M102, M225 Rational::numerator M102, M225 Rational::operator double M25 Rational::operator+= M107 Rational::operator-= M107 Rational::Rational M25, M102, M225 RCIPtr::~RCIPtr M209 RCIPtr::CountHolder M209 RCIPtr::CountHolder::~CountHolder M209 RCIPtr::init M209 RCIPtr::operator* M209, M210 RCIPtr::operator= M209, M210 RCIPtr::operator- M209, M210 RCIPtr::RCIPtr M209 RCObject::~RCObject M194, M204, M205 RCObject::addReference M195, M204, M205 RCObject::isShareable M195, M204, M205 RCObject::isShared M195, M204, M205 RCObject::markUnshareable M195, M204, M205 RCObject::operator= M194, M195, M204, M205 RCObject::RCObject M194, M195, M204, M205 RCObject::removeReference M195, M204, M205 RCPtr::~RCPtr M199, M202, M203, M206 RCPtr::init M199, M200, M203, M206 RCPtr::operator* M199, M203, M206 RCPtr::operator= M199, M202, M203, M206 RCPtr::operator-> M199, M203, M206 RCPtr::RCPtr M199, M203, M206 RCWidget::doThis M210 RCWidget::RCWidget M210 RCWidget::showThat M210 realMain M274 RealPerson::RealPerson E150 RegisterCollisionFunction::RegisterCollisionFunction M250 restoreAndProcessObject M88 returnStudent E98, E99 reverse M36 satelliteAsteroid M251 satelliteShip M251 Session::~Session M59, M60, M61, M77 Session::logCreation M59 Session::logDestruction M59, M77 Session::Session M59, M61 Set::cardinality E184 Set::insert E184 Set::member E184 Set::remove E184 set_new_handler E30, E32 shipAsteroid M245, M248, M250 shipStation M245, M250 simulate M272, M273 SmartPtr::operator SmartPtr M175 SmartPtr::operator SmartPtr M175 SmartPtr::~SmartPtr M160, M166 SmartPtr::operator SmartPtr M176 SmartPtr::operator void* M168 SmartPtr::operator! M169 SmartPtr::operator* M160, M166, M176 SmartPtr::operator= M160 SmartPtr::operator-> M160, M167, M176 SmartPtr::SmartPtr M160, M176 someFamousAuthor E127 someFunction M68, M69, M71 SpaceShip::collide M230, M231, M233, M234, M235, M237, M243 SpaceShip::hitAsteroid M235, M236, M243, M244 SpaceShip::hitSpaceShip M235, M236, M243 SpaceShip::hitSpaceStation M235, M236, M243 SpaceShip::initializeCollisionMap M239, M240, M241, M243 SpaceShip::lookup M236, M238, M239, M240 SpecialWindow::height M269 SpecialWindow::repaint M269 SpecialWindow::resize M269 SpecialWindow::width M269 Stack::~Stack E187 Stack::pop E187 Stack::push E187 Stack::Stack E187 Stack::empty E194 Stack::pop E194 Stack::push E194 Stack::StackNode::StackNode E186 stationAsteroid M245 stationShip M245 String::~String E50, M188 String::CharProxy::CharProxy M219, M222 String::CharProxy::operator char M219, M222 String::CharProxy::operator& M224 String::CharProxy::operator= M219, M222, M223 String::length E95, E96 String::markUnshareable M207 String::operator char* E94 String::operator const char* E126 String::operator= E9, E66, E73, E74, M183, M184, M189 String::operator[] E93, E126, M190, M191, M194, M204, M207, M218, M219, M220, M221 String::String E8, E50, M183, M187, M188, M193, M204, M207 String::StringValue::~StringValue M186, M193, M197, M204, M207 String::StringValue::init M204, M206 String::StringValue::StringValue M186, M193, M197, M201, M204, M206, M207 swap M99, M226 tempDir E223 testBookEntryClass M52, M53 TextBlock::clone M126 TextBlock::operator<< M128 TextBlock::print M129 theFileSystem E222 thePrinter M130, M131, M134 Tuple::displayEditDialog M161 Tuple::isValid M161 TupleAccessors::TupleAccessors M172 TVStation::TVStation M226 twiddleBits M272, M273 update M13 updateViaRef M14 UPInt::operator-- M32 UPInt::operator++ M32, M33 UPInt::operator+= M32 UPInt::UPInt M105 UPNumber::~UPNumber M146 UPNumber::destroy M146 UPNumber::operator delete M157 UPNumber::operator new M148, M157 UPNumber::UPNumber M146, M148 uppercasify M100 Validation_error::what M70 Wacko::Wacko E58 watchTV M227 Widget::~Widget M210 Widget::doThis M210 Widget::operator= M210 Widget::showThat M210 Widget::Widget M40, M210 Window::height M269 Window::repaint M269 Window::resize M269 Window::width M269 WindowHandle::~WindowHandle M49 WindowHandle::operator WINDOW_HANDLE M49 WindowHandle::operator= M49 WindowHandle::WindowHandle M49 X::operator new E38 example uses __cplusplus M273 auto_ptr M48, M57, M138, M164, M165, M240, M247, M257 const pointers M55 const_cast M13, M90, M221 dynamic_cast M14, M155, M243, M244, M261, M262 exception specifications M70, M73, M74, M75, M77 explicit E86, M29, M291, M293 find template M283 implicit type conversion operators M25, M49, M171, M175, M219, M225 in-class initialization of const static members M140 list template M51, M124, M154, M283 make_pair template M247 map template M95, M238, M245 member templates E111, M176, M291, M292, M293 mutable E96, M88 namespace E108, E118, E119, M132, M245, M246, M247 nested class using inheritance M197 operator delete M41, M155 operator delete[] M21 operator new M41, M155 operator new[] M21 operator& M224 operator->* (built-in) M237 pair template M246 placement new M21, M40 pointers to member functions M236, M238 pure virtual destructors M154, M194 reference data member M219 refined return type of virtual functions M126, M260 reinterpret_cast M15 setiosflags M111 setprecision M111 setw M99, M111 Standard Template Library (STL) M95, M125, M127, M155, M238, M247, M283, M284 static_cast M12, M18, M21, M28, M29, M231 typeid M231, M238, M245 using declarations E119, M133, M143 using directive E118, E119 vector template M11 exception class M66, M77 exception specifications E78, M72-M78 advantages M72 callback functions and M74-M75 checking for consistency M72 cost of M79 default behavior when violated E28 layered designs and M77 libraries and M76, M79 mixing code with and without M73, M75 templates and M73-M74 exception::what M70, M71 exceptions E135, M287 see also catch, throw causing resource leaks in constructors M52 choices for passing M68 destructors and M45 disadvantages M44 efficiency M63, M65, M78-M80 iostreams and E228 leading to unused objects E135 mandatory copying M62-M63 modifying throw expressions M63 motivation M44 operator new and M52 optimization M64 recent revisions to M277 rethrowing M64 specifications, see exception specifications standard E231, M66, M70 type conversions and M66-M67 unexpected, see unexpected exceptions use of copy constructor M63 use to indicate common conditions M80 virtual functions and M79 vs. setjmp and longjmp M45 explicit E67, E78, E85, M28-M31, M227, M294 see also example uses explicit qualification of names E30, E162 see also namespaces virtual functions and E196 extent, of class E59 extern "C" M272-M273 F facets, in standard C++ library E230 factory functions E149, E201 fake this M89 false E9, M3 Felix the Cat M123 fetch and increment M32 fetching, lazy M87-M90 field delimiters, implemented via virtual functions E202 Fields, Lorri Mxv find algorithm E184, E230, M283 first fit M67 fixed-format I/O M112 Fleming, Read Exix, Mxiii E107 for_each algorithm E230 formatting, in iostreams E229 forms for new casts E10 -E11 Forth M271 FORTRAN E17, E61, E231, M213, M215, M271, M288 forwarding functions E148 Franklin, Dan Exviii free M42, M275 combining with delete E20 destructors and E19-E20 free implementation of Standard Template Library (STL) M4 French, Donald Exvii, Mxv French, gratuitous use of E149, E220, M177, M185 friend functions E87-E88 interfaces and E83 friends, avoiding M108, M131 friendship, in real life E87 Frohman, Scott Exix fstream class M278 FTP site for More Effective C++ M8 see also Web sites FUDGE_FACTOR E15 fully constructed objects M52 function calls mechanics of E132 returning a result from E132 semantics of M35-M36 functional abstraction E89-E90 functions see also function calls, inline functions, virtual functions adding at runtime M287 C, and name mangling M271 callback M74-M75, M79 declaring E4 defining E4 deliberately not defining E116 factory E149, E201 for type conversions M25, M31 forwarding E148 friend, see friend functions global vs. member E84-E87 implicitly generated E212-E216 lifetime of return values E127-E128 member template, see member templates member, see member functions nonvirtual, meaning E167, E211 references to E121 return types, see return types return values, modifying E94 simple virtual, meaning E211 static, via inlining E139 type conversions and E86 virtual, see virtual functions future tense programming M252-M258 G Gajdos, Larry Exviii Gamma, Erich M288, M289 garbage collection M183, M212 generalizing code M258 generic (void*) pointers E110, E189, E191 -E194 private inheritance and E193 type safety and E192 German, gratuitous use of M31 Gibson, Paul Exix global functions, vs. member functions E84 -E87 global overloading of operator new/delete M43, M153 goddess, see Urbano, Nancy L. Gokul, Chandrika Exix Gootman, Alexander Exviii GUI systems M49, M74, M75 Guzikowski, Chris Mxv H halting problem E221 Hamlet, allusion to E133, M22, M70, M252 Hamlet, quotation from E11 Handle/Body classes E146-E149 handles dangling E128 object lifetimes and E127-E128 to inaccessible members E124, E126 Hansen, Tony Exix Harrington, John Exix has-a relationship, definition (English) E182 hash tables, standard C++ library and E229 Hastings, Battle of E154 head scratching, avoiding E89 header files see also headers inlining and E138 length, and compilation speed E80 name conflicts and E117 standard names E225-E226 vs. namespaces E119 headers see also header files E26 E26 E225 E225 E225, E226 E127 E225, E226 E107 M111 E225, E226 vs. E19 E225 E107 E107, E225 M65 M65 E27, M40 M40 E17-E18, E225, E226 E127 E226 E20, E225, E226 heap objects, see objects Helm, Richard M288, M289 Hennessy, John L. Mxi heuristic for vtbl generation M115 hiding class implementations E146-E152 hit rate, cache, inlining and E137 Hobbs, Bryan Mxiv Hoeren, Gerd Mxiii Horstmann, Cay Mxiii, Mxiv Huchital, Jill Exix, Mxiii I identifying abstractions M267, M268 identity, see object identity idioms M123 if statements defining variables in E181 vs. virtual functions E176 #ifdef E16 #ifndef E16 Iliad, Homer's M87 implementation of + in terms of +=, etc. M107 of libraries M288 of multiple dispatch M230-M251 of operators ++ and -- M34 of pass-by-reference M242 of pure virtual functions M265 of references M242 of RTTI M120-M121 of virtual base classes M118-M120 of virtual functions M113-M118 implementations decoupling from interfaces E164 default, danger of E163-E167 hiding E146-E152 inheritance of E161-E169 of derived class constructors and destructors E141 of Protocol classes E151 implicit conversions, see type conversions implicit type conversion operators, see type conversion operators implicit type conversions, see type conversions implicitly generated functions E212-E216 importing namespace elements E118-E119 #include directives E16 compilation dependencies and E144, E148 include files, see header files incorrect code, efficiency and E101, E124, E129, E131 increment and fetch M32 increment operator, see operator++ indexing, array inheritance and M17-M18 pointer arithmetic and M17 infinite loop, in operator new E35 inheritance see also multiple inheritance, public inheritance, private inheritance abstract classes and M258-M270 accessibility restrictions and E115 accidental E164-E165 advantages of E164 catch clauses and M67 combining with templates E31-E33, E193 common features and E164, E208 concrete classes and M258-M270 copy constructors and E71 delete and M18 emulated vtbls and M248-M249 intuition and E156-E160 libraries and M269-M270 mathematics and E160 nested classes and M197 of implementation E161-E169 of interface E161-E169 of interface vs. implementation E161-E169 operator delete and M158 operator new and E35-E36, M158 operator= and E69-E70 penguins and birds and E156-E158 private constructors and destructors and M137, M146 protected E156 public, see public inheritance rectangles and squares and E158-E160 redefining nonvirtual functions and E169-E171 sharing features and E164, E208 smart pointers and M163, M173-M179 type conversions of exceptions and M66 vs. templates E185-E189 when to use E189 initialization see also initialization order definition (English) E8 demand-paged M88 of arrays via placement new M20-M21 of const pointer members M55-M56 of const static members E14, M140 of emulated vtbls M239-M244, M249-M251 of function statics M133 of members, see member initialization of objects E8, M39, M237 of pointers M10 of references M10 of static members E14, E29, E57, E58, M140 of static objects inside functions E222 of static pointers to null E43 static M273-M275 via memberwise copy E213 virtual bases and E200 vs. assignment E8-E9, E136 for built-in types E56 maintenance and E55 with vs. without arguments E136 initialization order importance of E221 in a hierarchy E58 of non-local static objects E18, E221-E223, M133 inline functions see also inlining address of E140 as hint to compiler E138 code replication and E139 code size and E137 debuggers and E142 in More Effective C++ M7 optimizing compilers and E137 recursion and E138 that aren't inlined E138-E139, E223 thrashing and E137 treated as static E139 vs. #define E15-E16 vs. macros, efficiency and E16 inlining E137-E143 see also inline functions architecture-dependence of E143 compiler warnings and E143 constructors/destructors and E140-E142 dynamic linking and E142 function statics and M134 Handle classes and E152 header files and E138 in More Effective C++ M7 inheritance and E140-E142 library design and E142 Protocol classes and E152 recompiling and E142 relinking and E142 return value optimization and M104 virtual functions and E138 "virtual" non-member functions and M129 vtbl generation and M115 when not done E138 inner products E231 insomnia E154 instantiations, of templates M7 INT_MIN E107 integral members, initialization when static and const E14 integral types E15 interface classes E192 efficiency of E194 interfaces complete E79, E184 decoupling from implementations E164 design considerations E77-E78 design example E81-E83 friend functions and E83 in Java E200 inheritance of E161-E169 minimal E79-E81, E184 type-safe E192-E194 vs. implementations E144 internal linkage M134 International Standard for Information Systems Programming Language C++ E234 internationalization standard C++ library and E230 standard iostreams and E228 Internet Engineering Task Force, The Exx Internet sites, see Web sites invalid_argument class M66 invariants over specialization E167 iostream class M278 iostreams E17-E18, M280 conversion to void* M168 exceptions and E228 fixed-format I/O and M112 in standard C++ library E226, E228 internationalization and E228 vs. E19 header E225, E226 header E225 operator! and M170 standard vs. traditional E228 vs. stdio E17-E18, M110-M112 isa relationship, definition (English) E155 is-implemented-in-terms-of relationship E182, E190, E193, E194, E208 definition (English) E183 ISO/ANSI standardization committee M2, M59, M96, M256, M277 ISO/IEC JTC1/SC22/WG21 E234 istream typedef E226 iterators E184, M283 see also Standard Template Library example use E175, E176, E178, E179, E180, E181, E184 in standard library E232 operator-> and M96 vs. pointers M282, M284 J Jackson, Jeff Mxiv Japanese, gratuitous use of M45 Java E47, E146, E195 interfaces in E200 Johnson, Ralph M288, M289 Johnson, Tim Exix, Mxiii, Mxv K Kaelbling, Mike Exviii, Exix Kanze, James Mxii, Mxiii Kernighan, Brian Exviii, Exix, Mxi, Mxii, Mxiii, M36 Kimura, Junichi Exix King, Stephen E127 Kini, Natraj Exix Kirk, Captain, allusion to M79 Kirman, Jak Exix Klingon E97 Knauss, Frieder Exix Knuth, Donald Exv Koenig, Andrew Mxii Koffman, Dawn Exix Kreft, Klaus Exviii, Mxiii Khl, Dietmar Exvii Kuhlins, Stefan Exix Kuplinsky, Julio Exviii L Lakos, John Exviii, Exix Langer, Angelika Exviii Langlois, Lana Exx, Mxiv language lawyers M290 languages, other, compatibility with E61 Large-Scale C++ Software Design Exviii Latin, gratuitous use of M203, M252 layering E182-E185 compilation dependencies and E185 meanings of E182, E211 vs. private inheritance E190-E194 lazy construction M88-M90 lazy evaluation M85-M93, M94, M191, M219 conversion from eager M93 object dependencies and M92 when appropriate M93, M98 lazy fetching M87-M90 Lea, Doug Exvii, Exix leaks memory, see memory leaks resource, see resource leaks Lehrer, Tom, allusion to E3, E58 Lejter, Moises Exix lemur, ring-tailed E203 length_error class M66 Lewandowski, Scott Exix lhs, as parameter name E11, M6 libraries design and implementation M110, M113, M284, M288 exception specifications and M75, M76, M79 impact of modification M235 inheriting from M269-M270 iostream E17-E18, E228 multiple inheritance and E198 potential ambiguity and E114, E116 standard, for C E18, E28, E224, E226, E228, E230 standard, for C++, see standard C++ library Liebelson, Jerry Exix lifetime of function return values E127-E128 of temporary objects M278 limitations on type conversion sequences M29, M31, M172, M175, M226 limiting object instantiations M130-M145 E107 E107, E225 linkage C M272 internal M134 linkers, and overloading M271 link-time errors E14, E64, E117, E139, E219 vs. runtime errors E216 lint-like programs for C++ Exiii Linton, Mark Exviii LISP E65, E195, E216, M93, M230, M271 list template E174, E183, E184, E229, M4, M51, M124, M125, M154, M283 local objects construction and destruction E131 static E222 locales, in standard C++ library E230 locality of reference M96, M97 localization, support in standard C++ library M278 logic_error class E135, E231, M66 long int, as NULL E111 longjmp destructors and M47 setjmp and, vs. exceptions M45 Love-Jensen, John Exix LSD M287 Lutz, Greg Exix lvalue, definition M217 lying to compilers M241 M Madagascar E204 see also lemur, ring-tailed magazines C Users Journal Mxiii C++ Report Exvii, Exviii, Mxii, Mxiii, Mxv, M287, M289 C/C++ Users Journal Exviii, Mxiii, M289 recommended M289 magic numbers E108 main M251, M273, M274 maintenance M57, M91, M107, M179, M211, M227, M253, M267, M270, M273 adding class members and E24 common base classes and E164 downcasting and E176 large class interfaces and E80 member initialization lists and E55 references to functions and E120 RTTI and M232 the lure of multiple inheritance and E209 make_pair template M247 malloc M39, M42, M275 combining with new E20 constructors and E19-E20, M39 operator new and M39 Mangoba, Randy Exix map template E229, M4, M95, M237, M246, M283 Martin, Robert Exviii mathematics, inheritance and E160 max E16 McCluskey, Peter Exix McKee, Beth Mxv meaning of classes without virtual functions E61 of common base classes E210 of layering E182, E211 of nonvirtual functions E167, E211 of pass-by-value E7 of private inheritance E190, E210 of public inheritance E155, E210 of pure virtual functions E162, E211 of references E102 of simple virtual functions E163, E211 of undefined behavior E20 of virtual base classes E199 Medusa E75 Meltzer, Seth Exix member assignment E213 copying E213 data, see data members initialization order E58 initialization when static, const, and integral E14 pointers (i.e., pointers to members) E112, E130 static, initialization E29 templates E111 for implementing NULL E111-E112 member function templates see member templates member functions see also functions, member templates bitwise const E94 compatibility of C++ and C structs and M276 conceptually const E95-E97 const E92-E97, M89, M160, M218 handles and E128 handles and E128 implicitly generated E212-E216 invocation through proxies M226 pointers to E130, M240 private E57, E116 protected E165, E193 type conversions and E86 vs. global functions E84-E87 member initialization E213 see also member initialization lists of const members E53-E54 of const static integral members E14 of reference members E53-E54 order E58 vs. assignment E53-E57 member initialization lists M58 see also member initialization ?: vs. if/then and M56 base class constructors and E200 const members and E53-E54 reference members and E53-E54 try and catch and M56 member templates M165 approximating M294 assigning smart pointers and M180 copying smart pointers and M180 for type conversions E111, M175-M179 portability of M179 memberwise assignment E213 memberwise copy construction E213 memory allocation M112 see also memory management arrays and E36 error handling for E27-E33 for basic_string class M280 for heap arrays M42-M43 for heap objects M38 in C++ vs. C M275 memory layout of objects E198 memory leaks E25, E125, E133, M6, M7, M42, M145 see also resource leaks examples E51, E103 origin E45 vs. memory pools E44-E45 memory management see also memory allocation, operator new, operator delete custom, efficiency and E43 customizing M38-M43 memory pools E46-E48 memory values, after calling operator new M38 memory, shared M40 memory-mapped I/O M40 message dispatch, see multiple dispatch mf, as identifier E12 MI, see multiple inheritance Michaels, Laura Exix migrating from C to C++ M286 minimal interfaces E184 pros and cons E79-E81 minimizing compilation dependencies E143-E152 minimum values, discovering Mitchell, Margaret E127 mixed-mode arithmetic E85, E86 mixed-type assignments M183, M260, M261 prohibiting M263-M265 mixed-type comparisons M169 mixin classes E31, M154 mixing code C++ and C M270-M276 with and without exception specifications M75 mixing new/delete and malloc/free E20 mixin-style base classes E31, M154 mixin-style inheritance E31, M154 modifying function return values E94 Moore, Doug Exix More Effective C++ Exv, E237-E238 vs. Effective C++ E237 Web site for E237, M8 Morgan, Doug Exviii, Exix multi-dimensional arrays M213-M217 multi-methods M230 multiple dispatch M230-M251 multiple inheritance (MI) E194-E209, M153 ambiguity and E114-E115, E195, E200 clairvoyance and E199 class initialization order and E58 combining public and private E201-E205 complexities of E195-E201 controversy over E194 diamonds and E198 -E201 dominance and E200 libraries and E198 memory layout E198 object addresses and M241 poor design and E205-E209 space penalty for use of E199 vptrs and vtbls and M118-M120 multiple pointers, destructors and E191 Munsil, Wesley Exix Murray, Rob Exviii, Mxii, Mxiii, M286 mutable E95, M88-M90 Myers, Nathan Exviii N Nackman, Lee R. M288 Nagler, Eric Exix, Mxiii, Mxiv Naiman, Aaron Exix name conflicts E117 name function M238 name mangling M271-M273 named objects M109 optimization and M104 vs. temporary objects M109 namespace pollution avoiding E150 in a class E166 namespaces E117-E119, M132, M144 approximating E119-E122 potential ambiguity and E119 standard C++ library and M280 std, see std namespace unnamed M246, M247 naming conventions E11, E138, E144 NDEBUG, and assert macro E26 Nemeth, Evi Exx Neou, Vivian Mxiv nested classes, and inheritance M197 nested types, examples E186, E218 E27 new see also operator new, placement new combining with malloc E20 communication with delete E40 consistency with delete E43 example implementation E30, E32 forms of E26 hiding global new E37-E39 nothrow E33 operator new and E23 relationship to constructors E23 new cast examples const_cast E96, E97, E124 dynamic_cast E180, E181 static_cast E19, E42, E44, E70, E110, E114, E175, E176, E178, E192, E193, E194 new cast forms E10-E11 new language features, summary M277 new operator M37, M38, M42 bad_alloc and M75 operator new and constructors and M39, M40 operator new[] and constructors and M43 new/delete, vs. vector and string E229 new-handler definition (English) E26 deinstalling E28 discovering E35 finding out what it is E35 new-handling functions, behavior of E27 newsgroups, Usenet Exvii, Exviii, Mxi, M289 recommended M289 Newton, allusion to M41 Nguyen, Dat Thuc Exix nightmares, maintenance E176 non-local static objects E120, E221 non-member functions, acting virtual M128-M129 nonvirtual base classes E200 destructors E81 object deletion and E59-E63 functions E169-E171 meaning E211 static binding of E170 nothrow new E33 NULL E110-E113 address of E112 use by caller vs. use by callee E112 null pointers deleting E25, E36, M52 dereferencing M10 dynamic_cast and M70 in smart pointers M167 set_new_handler and E28 strlen and M35 testing for M10 the STL and M281 null references M9-M10 numeric applications M90, M279 support in standard C++ library E231 numeric_limits E106-E108 efficiency of E107 nuqneH E97 Nyman, Lars Exix O Object Pascal E195 Objective C E195 object-oriented design E153-E211 advantages of E164 common errors in E167-E169 objects addresses M241 allowing exactly one M130-M134 arrays of E5-E6 as function return type M99 assignments E8 through pointers M259, M260 compilation dependencies and E147 construction contexts for M136 lazy M88-M90 on top of one another M287 copying, and exceptions M62-M63, M68 counting instantiations E59, M141 -M145 declaring E4 defining E4, E135-E137 constructors and E135 deleting M173 determining location via address comparisons M150-M152 determining whether on the heap M147-M157 equality of E74-E75 identity of E74-E75 initialization E8, M39, M88, M237 with vs. without arguments E136 layout E198 lifetime when returned from functions E127-E128 limiting the number of M130-M145 locations M151 memory layout diagrams M116, M119, M120, M242 modifying when thrown M63 named, see named objects ownership M162, M163-M165, M183 partially constructed M53 phases of construction E54 preventing instantiations M130 prohibiting copying of E52 prohibiting from heap M157- M158 proxy, see proxy objects restricting to heap M145-M157 size cache hit rate and M98 determining E145 paging behavior and M98 small, passing E101 static, see static objects surrogate M217 temporary, see temporary objects unnamed, see temporary objects using dynamic_cast to find the beginning M155 using to prevent resource leaks M47-M50, M161 virtual functions and M118 vs. pointers, in classes M147 Occam, William of E207, E209 off-by-one errors E83 On Beyond Zebra, allusion to M168 on-line errata list for Effective C++ Exvi for More Effective C++ M8 operator delete E77, M37, M41, M84, M113, M173 see also delete, operator delete[] behavior of E36-E37 efficiency and E39, M97 inheritance and M158 non-member, pseudocode for E36 virtual destructors and E44 operator delete[] E36, E37, E77, M37, M84 delete operator and destructors and M43 private M157 operator new E77, M37, M38, M69, M70, M84, M113, M149 see also new, operator new[] arrays and E36 bad_alloc and E26, E33, E34, M75 behavior of E33-E36 calling directly M39 constructors and M39, M149-M150 efficiency and E39, M97 exception specification for E28 exceptions and M52 improving performance E40-E48 infinite loop within E35 inheritance and E35-E36, M158 malloc and M39 member, and "wrongly sized" requests E35 new operator and constructors and M40 new-handling functions and E27 non-member, pseudocode for E34 out-of-memory conditions and E25-E33 overloading E26, M43, M153 private M157 returning 0 and E33 std::bad_alloc and E26, E33, E34 values in memory returned from M38 zero-byte requests and E34 operator new[] E36, E77, M37, M42, M84, M149 see also new, operator new bad_alloc and M75 new operator and constructors and M43 private M157 operator overloading, purpose M38 operator void* M168-M169 operator! M37 in iostream classes M170 in smart pointers classes M169 operator!= M37 operator% M37 operator%= M37 operator& E212, M37, M74, M223 operator&& M35-M36, M37 operator&= M37 operator() M37, M215 operator* M37, M101, M103, M104, M107 as const member function M160 null smart pointers and M167 STL iterators and M96 operator*= M37, M107, M225 operator+ M37, M91, M100, M107, M109 template for M108 operator++ M31-M34, M37, M225 double application of M33 prefix vs. postfix M34 operator+= M37, M107, M109, M225 operator, M36-M37 operator- M37, M107 template for M108 operator-= M37, M107 operator-> M37 as const member function M160 STL iterators and M96 operator->* M37 operator-- M31-M34, M37, M225 double application of M33 prefix vs. postfix M34 operator. M37, M226 operator.* M37 operator/ M37, M107 operator/= M37, M107 operator:: M37 operator< M37 operator<< M37, M112, M129 declaring E87 vs. printf E17 why a member function M128 writing E17 operator<<= M37, M225 operator<= M37 operator= E64-E76, E116, M37, M107, M268 associativity of E64 bitwise copy and E50, E213 classes with pointers and M200 const members and E214-E216 const return type and E65 default implementation E50, E213 default signature of E65 derived classes and M263 impact on interfaces E82 implicit generation E212 inheritance and E69-E70, M259-M265 memberwise assignment and E213 mixed-type assignments and M260, M261, M263-M265 non-const parameters and M165 overloading E65 partial assignments and M259, M263-M265 pointer members and E50-E51 prohibiting use of E52 reference members and E214-E216 return type E65 smart pointers and M205 virtual M259-M262 void return type and E65 when not implicitly generated E214-E216 operator== M37 operator> M37 operator>= M37 operator>> M37 declaring E87 vs. scanf E17 operator>>= M37 operator?: M37, M56 operator[] M11, M37, M216 const vs. non-const M218 distinguishing lvalue and rvalue use M87, M217-M223 example declaration E82 overloading on const E92-E93 return type of E93 returning handle E126 operator[][] M214 operator^ M37 operator^= M37 operator| M37 operator|= M37 operator|| M35-M36, M37 operator~ M26, M37 operators implicit type conversion, see type conversion operators not overloadable M37 overloadable M37 returning pointers M102 returning references M102 stand-alone vs. assignment versions M107-M110 operators, overloaded, namespace approximations and E121 optimization E99, E105, E231 see also costs, efficiency inline functions and E137 of exceptions M64 of reference counting M187 of vptrs under multiple inheritance M120 profiling data and M84 return expressions and M104 return value, see return value optimization temporary objects and M104 via valarray objects M279 order of examination of catch clauses M67-M68 order of initialization, see initialization order ostream typedef E226 other languages, compatibility with E61 Ouija boards M83 out_of_range class M66 over-eager evaluation M94-M98 overflow_error class M66 overloadable operators M37 overloading enums and M277 function pointers and M243 linkers and M271 on const E92-E93 operator new/delete at global scope M43, M153 resolution of function calls M233 restrictions M106 to avoid type conversions M105-M107 user-defined types and M106 vs. default parameters E106-E109 ownership of objects M162, M183 transferring M163-M165 P Paielli, Russ Mxiii pair template M246 Pandora's box E195 Papurt, David Exviii, Exix parameter lists, type conversions and E86 parameters see also pass-by-value, pass-by-reference, passing small objects default, see default parameters passing, vs. throwing exceptions M62-M67 type conversions and, see type conversions unused M33, M40 partial assignments M259, M263-M265 partial computation M91 partial sums E231 partially constructed objects, and destructors M53 Pascal E57, E176 pass-by-pointer M65 pass-by-reference E99-E101 auto_ptrs and M165 const and M100 efficiency and E99 exceptions and efficiency and M65 implementation M242 temporary objects and M100 the STL and M282 type conversions and M100 pass-by-value E98 auto_ptrs and M164 copy constructors and E6, E98-E99 efficiency of E98-E99 exceptions and efficiency and M65 meaning of E7 the STL and M282 virtual functions and M70 passing exceptions M68 passing small objects E101 pathological behavior, custom memory management and E46 patterns M123, M288 Patterson, David A. Mxi Pavlov, allusion to M81 Payment, Simone Mxiv penguins and birds E156 -E158 performance, see costs, efficiency, optimization Persephone Exx, E215, Mxv phases of construction E54 placement new M39-M40 array initialization and M20-M21 delete operator and M42 Plato E98 pointer arithmetic array indexing and M17 inheritance and M17 -M18 pointer members see also pointers copy constructors and E51-E52 operator= and E50-E51 pointers see also pointer members as parameters, see pass-by-pointer assignment M11 bitwise const member functions and E94 circumventing access restrictions and E129-E131 compilation dependencies and E147 const E91, M55 in header file E14 to functions E121 dereferencing when null M10 determining whether they can be deleted M152-M157 dumb M159 for building collections E191 generic, see generic (void*) pointers implications for copy constructors and assignment operators M200 initialization M10, M55-M56 into arrays M280 multiple, and destructors E191 null, see null pointers object assignments and M259, M260 proxy objects and M223 replacing dumb with smart M207 returning from operators M102 smart, see smart pointers testing for nullness M10 to functions M15, M241, M243 vs. references to functions E121 to member functions E130, M240 to members E112 to pointers, vs. references to pointers E13 to single vs. multiple objects, and delete E23, E52 virtual functions and M118 void*, see generic (void*) pointers vs. iterators M284 vs. objects, in classes M147 vs. references M9-M11 when to use M11 Polonius, quotation from E11 polymorphism, definition M16 Pool class E46-E48 poor design code reuse and E206-E209 MI and E205-E209 Poor Richard's Almanac, allusion to M75 Poor, Robert Exix portability non-standard functions and M275 of casting function pointers M15 of determining object locations M152, M158 of dynamic_cast to void* M156 of member templates M179 of passing data between C++ and C M275 of reinterpret_cast M14 of static initialization and destruction M274 potential ambiguity E113-E116 namespaces and E119 prefetching M96-M98 prefixes, for names in libraries E117 relation to namespaces E117 preprocessor E26, E110 preventing object instantiation M130 principle of least astonishment M254 printf M112 vs. operator<< E17 priority_queue template M283 private constructors E218 private inheritance E189-E194, M143 for redefining virtual functions E204 generic (void*) pointers and E193 meaning E190, E210 vs. layering E190-E194 private member functions E57, E116 profiling, see program profiling program profiling M84-M85, M93, M98, M112, M212 programming in the future tense M252-M258 prohibiting assignment E52 copying E52 protected inheritance E156 member functions E165, E193 protected constructors and destructors M142 Protocol classes E149-E152, E173, E201 proxy classes M31, M87, M190, M194, M213-M228 see also proxy objects definition M217 limitations M223 -M227 proxy objects see also proxy classes ++, --, +=, etc. and M225 as temporary objects M227 member function invocations and M226 operator. and M226 passing to non-const reference parameters M226 pointers and M223 pseudo-constructorsM138, M139, M140 pseudo-destructors M145, M146 public inheritance, meaning of E155, E210 pun, really bad E157 pure virtual destructors E63-E64, M195, M265 see also destructors, pure virtual functions defining E63 implementing E63 inline E64 pure virtual functions E63, E197, M154 see also virtual functions, pure virtual destructors defining E162, E166-E167 meaning E162, E211, M265 push_back algorithm E184 Python, Monty, allusion to M62 Q queue template E229, M4, M283 R Rabinowitz, Marty Exx, Mxiv rand E127 range_error class M66 read-only libraries, downcasting and E179 recommended reading books M285-M289 magazines M289 on exceptions M287 Usenet newsgroups M289 recompilation, impact of M234, M249 rectangles and squares E158-E160 recursive functions, inlining and E138 recycling E131 redeclaring virtual functions E189 redefining inherited nonvirtual functions E169-E171 virtual functions E196-E197 Reed, Kathy Exvii, Mxv Reeves, Jack Exvii reference counting E52, M85-M87, M171, M183-M213, M286 assignments M189 automating M194-M203 base class for M194-M197 constructors M187-M188 cost of reads vs. writes M87, M217 design diagrams M203, M208 destruction M188 efficiency and M211 for standard strings E229 implementation of String class M203-M207 operator[] M190-M194 optimization M187 pros and cons M211-M212 read-only types and M208-M211 shareability and M192-M194 smart pointer for M198-M203 when appropriate M212 references see also pass-by-reference as function return types E99-E101 as handle to inaccessible members E126 as members E53-E54 as operator[] return type M11 assignment to M11 casting to E70 circumventing access restrictions and E129-E131 compilation dependencies and E147 constructors and M165 implementation E101, M242 mandatory initialization M10 meaning E102 null M9-M10 returning from operators M102 to functions E121 vs. pointers to functions E121 to locals, returning M103 to pointers, vs. pointers to pointers E13 to static object, as function return value E103-E105 virtual functions and M118 vs. pointers M9-M11 when to use M11 refined return type of virtual functions M126 Regen, Joel Exviii register E138 reinterpret_cast E10, M14-M15, M37, M241 Reiss, Steve Exix relationships among delete operator, operator delete, and destructors M41 among delete operator, operator delete[], and destructors M43 among new operator, operator new, and constructors M40 among new operator, operator new[], and constructors M43 among operator+, operator=, and operator+= M107 between operator new and bad_alloc M75 between operator new[] and bad_alloc M75 between terminate and abort M72 between the new operator and bad_alloc M75 between unexpected and terminate M72 has-a E182 isa E155-E158 is-implemented-in-terms-of E182, E183, E190, E193, E194, E208 replacing definitions with declarations E147 replication of code M47, M54, M142, M204, M223, M224 avoiding E109, E191-E193 replication of data under multiple inheritance M118-M120 reporting bugs in Effective C++ Exv in More Effective C++ M8 reporting bugs in More Effective C++ M8 research into lint-like programs for C++ Exiii resolution of calls to overloaded functions M233 resource leaks M46, M52, M69, M102, M137, M149, M173, M240 definition M7 exceptions and M45-M58 in constructors M52, M53 preventing via use of objects M47-M50, M58, M161 smart pointers and M159 vs. memory leaks M7 restrictions on accessibility under inheritance E115 on classes with default constructors M19-M22 rethrowing exceptions M64 return expression, and optimization M104 return type const E92, E125, M33-M34, M101 handle to inaccessible members E124 objects M99 of operator-- M32 of operator++ M32 of operator= E65 of operator[] E93, M11 of smart pointer dereferencing operators M166 of virtual functions M126 reference as M103 temporary objects and M100-M104 return value optimization M101-M104, M109 return values, lifetime of E127-E128 return-by-value E98 copy constructors and E6 reuse, see code reuse reusing custom memory management strategies E46-E48 Rhodes, Neil Exix rhs, as parameter name E11, M6 rights and responsibilities M213 Ritchie, Dennis M. Exviii, M36 Rodoni, Rene Exix Romeo and Juliet, allusion to E104, M166 Rooks, Alan Exix Rosenthal, Steve Mxiii rotate algorithm E230 Roux, Cade Exix Rowe, Robin Mxiii RTTI M6, M261-M262 implementation M120-M121 maintenance and M232 virtual functions and M120, M256 vs. virtual functions M231-M232 vtbls and M120 rule of 80-20 E143, E168 Rumsby, Steve Mxiv runtime errors E110, E157 converting to compile-time errors E217-E219 in C or C++ E216 standard C++ library and E231 vs. compile-time errors E216 vs. link-time errors E216 runtime type identification, see RTTI runtime_error class E231, M66 rvalue, definition M217 S safe casts M14 safe downcasting E179 -E181 Saks, Dan Mxi, Mxiii, Mxiv sanity checking, eliminating E217 Santos, Eugene, Jr. Exix Satyricon Ei scanf, vs. operator>> E17 Scarlet Letter, The, allusion to M232 Scientific and Engineering C++ M288 scoping E30, E162 see also namespaces Scott, Roger Exviii, Exix search algorithm E230 second edition of Effective C++, changes for Exiv-Exv self, assignment to E71-E73 Sells, Chris Mxiii, Mxiv semantics of function calls M35-M36 separate translation, impact of E233 separating interfaces and implementations E146-E152 sequences of type conversions M29, M31, M172, M175, M226 sequences, in standard C++ library E230 set template E182, E229, M4, M283 set_new_handler E27-E33 class-specific, implementing E28-E33 vs. try blocks E33 set_unexpected M76 setiosflags, example use M111 setjmp and longjmp, vs. exceptions M45 setprecision, example use M111 setw, example uses M99, M111 Shakespeare, William, quotation from E11 shared memory M40 sharing common features E164, E208 sharing values M86 see also reference counting Shewchuk, John Exvii, Exix short-circuit evaluation M35, M36 Shteynbuk, Oleg Exix simple virtual functions, meaning of E163, E211 Simpson, Rosemary Exx single-argument constructors, see constructors Singleton pattern E222 Siva, Pradeepa Mxiv sizeof E19, E35, M37 freestanding classes and E36 sizes of freestanding classes E36 of objects E145 Skaller, John Max Mxiv sleep deprivation Mxv sleeping pills E154 slices, in standard C++ library E231 slicing problem E99-E101, M70, M71 small objects memory allocation and E39-E48 passing E101 Smallberg, Dave Exix Smalltalk E146, E157, E158, E176, E195, E216 smart pointers M47, M90, M159-M182, M240, M282 assignments M162-M165, M180 const and M179-M182 construction M162 conversion to dumb pointers M170-M173 copying M162-M165, M180 debugging M182 deleting M173 destruction M165-M166 distributed systems and M160-M162 for reference counting M198-M203 inheritance and M163, M173-M179 member templates and M175-M182 operator* M166-M167 operator-> M166-M167 replacing dumb pointers M207 resource leaks and M159, M173 testing for nullness M168-M170, M171 virtual constructors and M163 virtual copy constructors and M202 virtual functions and M166 Socrates E98 allusion to Exx Some Must Watch While Some Must Sleep E154 Somer, Mark Exix sort algorithm E230 Spanish, gratuitous use of M232 specialization, invariants over E167 specification, see interfaces sqrt function M65 squares and rectangles E158-E160 stack objects, see objects stack template E229, M4, M283 Stacy, Webb Mxiii standard C library E18, E28, E224, E226, E228, E230, M278 standard C++ library E224-E232, M1, M4-M5, M11, M48, M51, M280 see also Standard Template Library and E148 and E107 abort and E28 adjacent differences and E231 algorithms within E229 array replacements and E24 basic_ostream template E226, E227 bitset template E229 C headers and E225 cleverness within E108 code reuse and M5 complex template E226, E231 containers within E174, E175, E184, E229 copy algorithm E230 count_if algorithm E230 deque template E229 diagnostics support E231, M66 equal algorithm E230 exception hierarchy within E231 exit and E28 facets and E230 find algorithm E184, E230 for_each algorithm E230 hash tables and E229 headers for, see header files inner products and E231 internationalization support E230 iostreams and E18, E19, E228 istream typedef E226 iteration over containers in E184 list template E174, E183, E184, E229 logic_error and E135 map template E229 max and E16 namespaces and E119 numeric_limits and E107 ostream typedef E226 performance guarantees of E229, E230 push_back algorithm E184 queue template E229 rotate algorithm E230 search algorithm E230 sequences within E230 set template E182, E229 sort algorithm E230 stack template E229 string and E7, E226 stringstream template E228 summary of features M278-M279 support for errors E231 support for numeric processing E231 support for slices E231 unique algorithm E230 use of allocators within E227 use of templates M279, M280 use of traits within E227 valarray template E231 vector template E24, E57, E62, E81, E226, E229 standard headers, see header files standard include files, see header files Standard Template Library (STL) E175, E232, M4-M5, M95-M96, M280-M284 see also standard C++ library conventions of E232, M284 example uses, see example uses extensibility of E232, M284 free implementation M4 iterators and operator-> M96 pass-by-reference and M282 pass-by-value and M282 standardization committee, see ISO/ANSI standardization committee Star Wars, allusion to M31 Stasko, John Exix static array, returning references to E105 binding of default parameters E173 of nonvirtual functions E170 destruction M273-M275 functions, generated from inlines E139 initialization M273-M275 members, see static members objects, see static objects type, see static type static members E130 const member functions and E94 definition E29 initialization E14, E29, E57, E58 use in namespace approximations E119-E122 static objects M151 at file scope M246 in classes vs. in functions M133-M134 in functions M133, M237 inlining and M134 returning references to E103-E105 when initialized M133 static type vs. dynamic type E171-E172, M5-M6 when copying M63 static_cast E10, M13, M14, M15, M37 example use E19, E42, E44, E70, E110, E114, E175, E176, E178, E192, E193, E194 std namespace M261 see also standard C++ library vs. and E19 bad_alloc and E26, E35 basic_string and E227 header names and E225, E226 numeric_limits and E107, E108 set_new_handler and E30 standard C++ library and E119, E225, M280 string and E227 stdio, vs. iostreams E17-E18, M110-M112 efficiency and E18 E17-E18, E225, E226 E127 Steinmller, Uwe Exviii, Exix stepping through functions, inlining and E142 STL, see Standard Template Library strategy, for inlining E142 strdup E20, M275 string classes E7 see also string type vs. char*s E8, M4 string headers E226 E225, E226 E20 string type E7, E226-E228, E229, M27, M279-M280 as standard container E229 c_str member function M27 declaring E227 -E228 destructor M256 typedef for E226 vs. String E7 String, vs. string E7 see also reference counting stringstream template E228, M278 strlen E97 null pointer and M35 strong typing bypassing M287 implementing E192-E194 Stroustrup, Bjarne Exvii, Exix, E64, E233, E234, E235, Mxii, Mxiii, M285, M286 strstream class M278 structs as namespace approximations E119-E122 compatibility between C++ and C M276 constructors and E186 private M185 summaries of efficiency costs of various language features M121 of new language features M277 of standard C++ library M278-M279 suppressing type conversions M26, M28-M29 warnings for unused parameters M33, M40 Surgeon General's tobacco warning, allusion to M288 surrogates M217 Susann, Jacqueline M228 Swift, Dave Mxiii switches on types, vs. virtual functions E176 system calls M97 T Taligent's Guide to Designing Programs Exviii, Mxii Teitelbaum, Glenn Exix templates E187, M286, M288 ">>", vs. "> >" and M29 code bloat and E190 combining with inheritance E31-E33, E193 declaring E4 default constructors and M22 defining E5 exception specifications and M73-M74 for iostream classes E226 for operator+ and operator- M108 in standard C++ library E226-E228, M279-M280 member, see member templates pass-by-reference and M282 pass-by-value and M282 recent extensions M277 specializing M175 static data members and M144 type-safe interfaces and E194 vs. inheritance E185-E189 vs. template instantiations M7 when to use E187 temporary objects E67, E134, M34, M64, M98-M101, M105, M108, M109, M110 catching vs. parameter passing M65 efficiency and M99-M101 eliminating M100, M103-M104 exceptions and M68 function return types and M100-M104 handles to E127-E128 lifetime of M278 optimization and M104 pass-by-reference and M100 type conversions and M99-M100 vs. named objects M109 terminate M72, M76 terminology used in Effective C++ E4-E12 terminology used in More Effective C++ M5-M8 this assignment to E141 deleting M145, M152, M157, M197, M213 effective type of E96 thrashing, and inline functions E137 throw see also catch by pointer M70 cost of executing M63, M79 modifying objects thrown M63 to rethrow current exception M64 vs. parameter passing M62-M67 Tilly, Barbara Exix Tondo, Clovis Exix traits E227 transforming concrete classes into abstract M266-M269 translation units E138 definition (English) E220 Treichel, Chris Exviii, Exix true E9, M3 Trux, Antoine Exix try blocks M56, M79 Twilight Zone E63 type see also types conversions E78, E85 ambiguity and E113-E114 global functions and E86 implicit E67, E83, E85, E86 involving long int vs. int E111 member functions and E86 private inheritance and E190 design E77-E78 of this E96 safety, and generic (void*) pointers E192 type conversion functions M25-M31 see also type conversion operators valid sequences of M29, M31, M172, M175, M226 type conversion operators M25, M26-M27, M49, M168 see also type conversion functions smart pointers and M175 via member templates M175-M179 type conversions M66, M220, M226 avoiding via overloading M105-M107 exceptions and M66-M67 function pointers and M241 implicit M66, M99 pass-by-reference and M100 suppressing M26, M28-M29 temporary objects and M99-M100 via implicit conversion operators M25, M26-M27, M49 via single-argument constructors M27-M31 type errors, detecting at runtime M261-M262 type system, bypassing M287 type_info class M120, M121, M261 name member function M238 type-based switches, vs. virtual functions E176 typedefs new/delete and E24 use in namespace approximations E120 typeid M37, M120, M238 types see also type adding to improve error detection E217 integral (English definition) E15 nested, see nested types private E186 static vs. dynamic M5-M6 when copying M63 type-safe interfaces E192-E194 typing, strong, implementing E192-E194 U undefined behavior calling strlen with null pointer M35 casting away constness of truly const objects E97 dangling pointers to temporary objects and E128 deallocating memory still in use E47 deleting a derived array via a base class pointer M18 deleting arrays via non-array delete E23 deleting deleted pointers E52 deleting derived objects via base pointers E60, E62 deleting memory not returned by new M21 deleting objects twice M163, M173 deleting objects via array delete E23 dereferencing an arrays' one-beyond-the-end pointer M281 dereferencing null pointers M10, M164, M167 initialization order of non-local static objects and E221 meaning of E20 mixing new/delete and malloc/free E20 mixing new/free or malloc/delete M275 operating on deleted objects E73 order of evaluation of parameters M36 referring to a string element after the string has been modified M192 returning references to local objects and E133 uninitialized objects and E217, E220 uninitialized pointers and E219 underbar, as naming convention E144 unexpected M72, M74, M76, M77, M78 unexpected exceptions M70 see also unexpected handling M75-M77 replacing with other exceptions M76 Unicode M279 union E41 union, using to avoid unnecessary data M182 unique algorithm E230 unnamed classes, compiler diagnostics and E112 unnamed namespaces M246, M247 unnamed objects, see temporary objects unnecessary objects, avoiding E137 unused objects cost of E135 resulting from exceptions E135 unused parameters, suppressing warnings about M33, M40 Urbano, Nancy L. Exix, Exx, Mxiv, Mxv see also goddess, Clancy URLs, see Web sites use counting M185 see also reference counting useful abstractions M267 Usenet newsgroups Exvii, Exviii, Mxi, M289 recommended M289 USENIX Association Exx user-defined conversion functions, see type conversion functions user-defined types consistency with built-ins M254 overloaded operators and M106 using declarations M133, M143 see also namespaces V valarray template E231, M279, M280 value equality E74 values, as parameters, see pass-by-value Van Wyk, Chris Exix, Mxiii variables, defining E135-E137 constructors and E135 in if statements E181 vector template E24, E57, E62, E81, E226, E229, M4, M11, M22, M283 Vinoski, Steve Exix, Mxiii virtual base classes E198, E200, M118-M120, M154 complexities of E201 cost of E198, E118-E120 data members in E200 default constructors and M22 initialization of E200 meaning of E199 object addresses and M241 virtual constructors E149, E150, M46, M123-M127 see also virtual copy constructors definition M126 example uses M46, M125 smart pointers and M163 virtual copy constructors M126-M127 see also virtual constructors smart pointers and M202 virtual destructors M143, M254-M257 see also pure virtual destructors behavior of E61 delete and M256 object deletion and E59-E63 pure, see pure virtual destructors virtual functions E186 see also functions, pure virtual functions, virtual destructors as customization mechanism E206-E207 compatibility with other languages and E61 default implementations and E163-E167 "demand-paged" M253 design challenges M248 dominance and E200 dynamic binding of E170 dynamic_cast and M14, M156 efficiency and E168, M113-M118 exceptions and M79 explicit qualification and E196 for implementing field delimiters E202 implementation E61-E62, M113-M118 meaning of none in class E61 mixed-type assignments and M183, M260, M261 pass/catch-by-reference and M72 pass/catch-by-value and M70 pure, see pure virtual functions redeclaring E189 redefining E196-E197 refined return type M126, M260 RTTI and M120, M256 simple, meaning of E163, E211 smart pointers and M166 vs. catch clauses M67 vs. conditionals and switches E176 vs. dynamic_cast E180 vs. RTTI M231-M232 vtbl index M117 "virtual" non-member functions M128-M129 virtual table pointers, see vptrs virtual tables, see vtbls Vlissides, John M288, M289 void* pointers, see generic (void*) pointers void*, dynamic_cast to M156 volatileness, casting away M13 vptrs E61, M113, M116, M117, M256 effective overhead of M256 efficiency and M116 optimization under multiple inheritance M120 vtbls E61, E64, M113-M116, M117, M121, M256 emulating M235-M251 heuristic for generating M115 inline virtual functions and M115 RTTI and M120 W Wait, John Exx, Mxiv, Mxv warnings from compiler E223-E224 suppressing, for unused parameters M33, M40 Weaver, Sarah Exx Web sites for Effective C++ Exvi for free STL implementation M4 for More Effective C++ E237, M8 what function M70, M71 When Bad Things Happen to Good People, allusion to E181 wide characters M279 Wild, Fred Mxiii Wildlife Preservation Trust International William of Occam E207, E209 Williams, Russ Exix Wizard of Oz, allusion to E159 Wright, Kathy Exx writing the author Exv, M8 WWW sites, see Web sites X X Files, The, allusion to E51 XYZ Airlines E163 Y Yiddish, gratuitous use of M32 Yogi Bear, allusion to E103 Z Zabluda, Oleg Exix Zell, Adam Exix Zenad, Hachemi Mxiv zero as int E109 as pointer E109