Home Segments Index Top Previous Next

Chapter 47:

How To Implement Lists

In this chapter, you learn about storing objects in lists. There are several reasons why learning about lists is important, the most conspicuous of which is that the implementation of lists demonstrates that you can use C++ classes to implement programming-language features, as well as to represent domain-specific concepts.

Another reason to learn about lists is that list manipulation is a useful tool. When you use a list, instead of an ordinary array, you do not need to anticipate how many objects you will need to store, so you can conserve the space that would be wasted by safe worst-case estimates.

A third reason to learn about lists is that list manipulation provides a compelling context for the introduction of other C++ concepts such as class friends and template functions.

To work with lists in C++, you have to extend the language by defining new C++ classes and member functions. Understanding what you have to do is not easy, so once you have understood the material in this and the remaining chapters, you can consider yourself well beyond the novice stage as a C++ programmer.