In this chapter, we have, hopefully, demystified the programming technique known as type erasure. We have shown how a program can be written without all of the type information being explicitly visible, and some of the reasons why this may be a desirable implementation. We have also demonstrated that not every problem, or every program, needs type erasure. For many applications, this is simply the wrong tool. Even when it simplifies the program, performance considerations may ultimately weigh against using type-erased constructs. However, when implemented efficiently and used wisely, it is a powerful technique that may lead to much simpler and flexible interfaces.
The next chapter is a change of direction—we are done with the abstraction idioms for some time and now move on to C++ idioms that facilitate binding of template components into complex interacting systems...