Apache C++ Standard Library User's Guide

## 32.1 A Note on User-Defined Types

One of the major advantages of the iostreams facility is extensibility. Just as you have inserters and extractors for almost all types defined by the C++ language and library, you can implement extractors and inserters for all your own user-defined types. To avoid surprises, the input and output of user-defined types should follow the same conventions used for insertion and extraction of built-in types. In this chapter, we give guidelines for building a typical extractor and inserter for a user-defined type.