3. Typelists

Typelists are a C++ tool for manipulating collections of types. They offer for types all the fundamental operations that lists of values support.

Some design patterns specify and manipulate collections of types, either related by inheritance or not. Notable examples are Abstract Factory and Visitor (Gamma et al. 1995). If you use traditional coding techniques, you can only manipulate collections of types by sheer repetition. This repetition leads to a subtle form of code bloating. Most people don’t think it could get any better than that. However, typelists let you automate tasks that you usually confine to your editor’s macro capability. Typelists bring power from another planet to C++, enabling it to support new, interesting idioms. ...

Get Modern C++ Design: Generic Programming and Design Patterns Applied 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.