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, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.