20. Derived Classes

Do not multiply objects without necessity.

– William Occam

Introduction

Derived Classes

Member Functions; Constructors and Destructors

Class Hierarchies

Type Fields; Virtual Functions; Explicit Qualification; Override Control; using Base Members; Return Type Relaxation

Abstract Classes

Access Control

protected Members; Access to Base Classes; using-Declarations and Access Control

Pointers to Members

Pointers to Function Members; Pointers to Data Members; Base and Derived Members

Advice

20.1. Introduction

From Simula, C++ borrowed the ideas of classes and class hierarchies. In addition, it borrowed the design idea that classes should be used to model concepts in the programmer’s and the application’s world. C++ ...

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

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