Appendix A. Grammar


There is no worse danger for a teacher than to teach words instead of things.

 --Marc Block

Introductionkeywordslexical conventionsprogramsexpressionsstatementsdeclarationsdeclaratorsclassesderived classesspecial member functionsoverloadingtemplatesexception handlingpreprocessing directives.


This summary of the C++ syntax is intended to be an aid to comprehension. It is not an exact statement of the language. In particular, the grammar described here accepts a superset of valid C++ constructs. Disambiguation rules (§A.5, §A.7) must be applied to distinguish expressions from declarations. Moreover, access control, ambiguity, and type rules must be used to weed out syntactically ...

Get The C++ Programming Language, Special Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.