Lesson #7

Operator Overloading: Additional Topics

Overview

In this lesson I will cover the following topics

  1. Overloading operator[]

  2. Overloading operator->

  3. Overloading operator()

  4. operator++() vs operator++(int)

Body

Introduction

This lesson contains some additional details on operator overloading. The material in this lesson is of a somewhat advanced nature; it would be reasonable for you to skip this lesson on a first reading and return to it when you are further along in your study. However, the techniques I cover here are essential for advanced C++ libraries, such as the Standard Template Library (STL). I feel it is important to discuss them at this stage so that you are better able to understand what the STL is doing when I introduce it in a later lesson.

Summary

  1. ...

© Copyright 2007 by Peter C. Chapin.
Last Revised: July 25, 2007