Skip to Main Content
C++ In a Nutshell
book

C++ In a Nutshell

by Ray Lischner
May 2003
Intermediate to advanced content levelIntermediate to advanced
808 pages
32h 24m
English
O'Reilly Media, Inc.
Content preview from C++ In a Nutshell

Name

class keyword — Declares a class or template parameter, or elaborates a type name

Synopsis

               class-specifier ::= class-head { [member-specification] }
class-head ::= class-key [identifier] [base-clause] | 
    class-key nested-name :: identifier [base-clause] |
    class-key [nested-name ::] template-id [base-clause] class-key ::= class | 
    struct | union
member-specification ::= member-decl [member-specification] | 
    access-specifier : [member-specification]
member-decl ::= [decl-specifier-seq] [member-declarator-list] ; | 
    function-definition [;] | qualified-id ; | using-decl | template-decl
               member-declarator-list ::= member-declarator | 
    member-declarator-list , member-declarator
               member-declarator ::= declarator [= 0] | declarator [= constant-expression] |
    [identifier] : constant-expression
               base-clause ::= : base-specifier-list
               base-specifier-list ::= base-specifier | base-specifier-list , base-specifier
               base-specifier ::= [base-modifiers] [::] [nested-name ::] class-name
               base-modifiers ::= virtual [access-specifier] | access-specifier [virtual]
access-specifier ::= private | protected | public
class-name ::= identifier | template-id
               type-parm := class [identifier] [= type-id] | 
    template < template-parm-list > class [identifier] [= id-expression]
elaborated-type-specifier := class-key [::] [nested-name ::] identifier | 
    class-key [::] [nested-name ::] [template] template-id
            

The class keyword introduces a class declaration or definition, names a type template parameter (type-parm), or names ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C++ High Performance

C++ High Performance

Viktor Sehr, Björn Andrist
Optimized C++

Optimized C++

Kurt Guntheroth
Mastering C++ Programming

Mastering C++ Programming

Jeganathan Swaminathan

Publisher Resources

ISBN: 059600298XSupplemental ContentErrata Page