O'Reilly logo

The C++ Programming Language, Fourth Edition by Bjarne Stroustrup

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

16. Classes

Those types are not “abstract”; they are as real as int and float.

– Doug McIlroy

Introduction

Class Basics

Member Functions; Default Copying; Access Control; class and struct; Constructors; explicit Constructors; In-Class Initializers; In-Class Function Definitions; Mutability; Self-Reference; Member Access; static Members; Member Types

Concrete Classes

Member Functions; Helper Functions; Overloaded Operators; The Significance of Concrete Classes

Advice

16.1. Introduction

C++ classes are a tool for creating new types that can be used as conveniently as the built-in types. In addition, derived classes (§3.2.4, Chapter 20) and templates (§3.4, Chapter 23) allow the programmer to express (hierachical and parametric) relationships ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required