The C++ language is without doubt a large and complex language.
Fortunately, an increasing number of textbooks have
become available which provide an appropriate introduction
to C++ and its use for the realization of abstract
data types, including [Heading] and [Weiss93].
Among the additional keywords introduced in C++
(extending C) we have the
(which may be used to define constants),
the keyword inline
(which may be used to define inline expanded functions,
that for C have to be defined using macros),
the keyword new
(to dynamically create objects on the heap),
the keyword delete
(to destroy dynamically created objects)
the keywords private, public and
(to indicate access restrictions for the instances
of an object class).
- inline, new, delete, private, protected, public
- constructors -- to create and initialize
- destructors -- to reclaim resources
- virtual functions -- dynamic binding
- (multiple) inheritance -- for refinement
- type conversions -- to express relations between types
- private, protected, public -- for access protection
- friends -- to allow for efficient access
slide: C++ -- terminology (1)
The language features offered by C++
supporting object-oriented programming
(which are defined for each class to create
and initialize instances),
(which may be used to reclaim resources),
(which must be used to effect dynamic binding),
(to specify behavioral refinement),
(which allow the user to define coercion relations
between, both system-defined and user-defined,
and friend declarations
(which may be used to grant efficient access
to selected functions or classes).
The annotated reference manual (ARM) is not a book
to be used
to learn the language, but provides an excellent
source of detailed technical explanations
and the motivations underlying particular
Some basic terminology
-- denotes an object, a function, set of functions, enumerator, type,
class member, template, a value or a label
- introduced by a declaration,
- used within a scope, and
- has a type which determines its use.
-- region of storage
- a named object has a storage class that determines
its lifetime, and
- the meaning of the values found in an object
is determined by the type of the expression
used to access it
slide: C++ -- terminology (2)
To get an idea of the full set of features offered
by C++, look at the meaning of a name in C++ (as described
in the ARM).
A name can either denote an object,
a function, a set of functions, an enumerator, a type
(including classes, structs and unions),
a class member, a template (class or function),
a value or a label.
A name is typically introduced by a declaration,
and is used within a scope.
Moreover, each name has a type which determines its use.
An object in C++ is nothing but a
region of storage,
with a lifetime determined by its storage class
(that is, whether it is created on the stack or on the
Meaning is given to an object by the type
used to access it, which is determined during compile
The only information needed at runtime in C++
is concerned with virtual functions
(which require a virtual function dispatch table
for dynamic binding).