HAPPY BOOKSGIVING
Use code BOOKSGIVING during checkout to save 40%-55% on books and eBooks. Shop now.
Register your product to gain access to bonus material or receive a coupon.
This book provides a complete reference for the C++ programming language. It consists of the C++ reference manual, approved as the base document for ANSI standardization of the language, plus annotations and commentary.
The annotations and commentary discuss what is not included in the language, why certain features are defined as they are, and how one might implement particular features. The commentaries also help the reader to understand the relationships between parts of the language. Comparisons with C and examples explain the more subtle points of the language.
Sixteen chapters cover the latest version of C++ including multiple inheritance, abstract classes, templates, exception handling, and more. A final chapter describes resolutions by the ANSI/ISO committee including new features such as run-time type information and namespaces. Appendices summarize the grammar and evolution of the language, and explain in detail the differences between C and C++.
The Annotated C++ Reference Manual will appeal to language implementors and expert C++ programmers.
Preface.
1. Introduction.
Overview.
Syntax Notation.
Evolution of C++.
Acknowledgements.
Tokens.
Comments.
Identifiers.
Keywords.
Literals.
Implementation Dependencies.
Declarations and Definitions.
Scopes.
Program and Linkage.
Start and Termination.
Storage Classes.
Types.
Lvalues.
Name Spaces.
Numerical Limits.
Integral Promotions.
Integral Conversions.
Float and Double.
Floating and Integral.
Arithmetic Conversions.
Pointer Conversions.
Reference Conversions.
Pointers to Members.
Arithmetic Conversions.
Primary Expressions.
Postfix Expressions.
Unary Operators.
Explicit Type Conversion.
Pointer-to-Member Operators.
Multiplicative Operators.
Additive Operators.
Shift Operators.
Relational Operators.
Equality Operators.
Bitwise AND Operator.
Bitwise Exclusive OR Operator.
Bitwise Inclusive OR Operator.
Logical AND Operator.
Logical OR Operator.
Conditional Operator.
Assignment Operators.
Comma Operator.
Constant Expressions.
Labeled Statement.
Expression Statement.
Compound Statement, or Block.
Selection Statements.
Iteration Statements.
Jump Statements.
Declaration Statement.
Ambiguity Resolution.
Specifiers.
Enumeration Declarations.
Asm Declarations.
Linkage Specifications.
Linkage Specifications.
Type-safe Linkage.
Limitations.
Type Names
Meaning of Declarators.
Function Definitions.
Initializers.
Pointers to Members.
Class Names.
Class Members.
Member Functions.
Static Members.
Unions.
Bit-Fields.
Nested Class Declarations.
Local Class Declarations.
Local Type Names.
Interfaces.
Multiple Base Classes.
Virtual Functions.
Abstract Classes.
Summary of Scope Rules.
Single Inheritance.
Multiple Inheritance.
Multiple Inheritance and Casting.
Multiple Inheritance and Implicit Conversion.
Virtual Base Classes.
Virtual Base Classes and Casting.
Single Inheritance and Virtual Functions.
Multiple Inheritance and Virtual Functions.
Instantiation of Virtual Functions.
Virtual Base Classes with Virtual Functions.
Renaming.
Access Specifiers.
Access Specifiers for Base Classes.
Access Declarations.
Friends.
Protected Member Access.
Access to Virtual Functions.
Multiple Access.
General Ideas.
Per Class Protection.
Access Control.
Constructors.
Temporary Objects.
Conversions.
Destructors.
Free Store.
Initialization.
Constructors and Destructors.
Copying Class Objects.
Temporary Elimination.
Access Control and Special Functions.
Summary of Member, Friend, and Special Functions.
Declaration Matching.
Argument Matching.
Address of Overload Function.
Overloaded Operators.
Templates.
Class Templates.
Type Equivalence.
Function Templates.
Declarations and Definitions.
Member Function Templates.
Friends.
Static Members and Variables.
Exception Handling.
Throwing an Exception.
Constructors and Destructors.
Handling and Exception.
Exception Specifications.
Special Functions.
Exceptions and Access.
Phases of Preprocessing.
Trigraph Sequences.
Macro Definition and Expansion.
File Inclusion.
Conditional Compilation.
Line Control.
Error Directive.
Pragmas.
Null Directive.
Predefined Names.
C++ Constructs versus #define.
Compatibility.
Classic C Preprocessing.
Keywords.
Expressions.
Declarations.
Declarators.
Class.
Statements.
Preprocessor.
Templates.
Exception.
Extensions.
C++ and ANSI C.
Anachronisms.
This book provides a complete language reference for the expert C++ user. It consists of the C++ reference manual plus annotations and commentary sections.
The C++ reference manual alone provides a complete definition of C++, but the terse reference manual style leaves many reasonable questions unanswered. Discussions of what is not in the language, why certain features are defined as they are, and how one might implement some particular feature have no place in a reference manual but are nevertheless of interest to most users. Such discussions are presented as annotations and in the commentary sections.
The commentary also helps the reader appreciate the relationships among different parts of the language and emphasizes points and implications that might have been overlooked in the reference manual itself. Examples and comparisons with C also make this book more approachable than the bare reference manual.
This book does not provide information about standard libraries beyond discussion of the library functions providing the most basic run-time support nor does it discuss C++ programming styles or techniques. Furthermore, this book does not attempt to teach C++ programming; it explains what the language is--not how to use it.
The index and the cross references embedded in the commentary and in the reference manual itself are important and integral parts of the book.
We hope that this reference manual will provide a firm base for further evolution of C++. It has been chosen by ANSI to serve as a starting point for the formal standardization of C++.
Margaret A. Ellis
Bjarne Stroustrup
Murray Hill, New Jersey
0201514591P04062001