One of the fundamental differences between the new, templated iostreams and the traditional iostreams is the ability of the new iostreams to accommodate user-defined character types. It's now possible to use the C++ iostreams interface with arbitrary character-like types, as well as with ordinary chars.
Of course, this flexibility comes at a price. Any user-defined character type must satisfy certain requirements. The type really must act like an ordinary char in most circumstances. In addition, several classes must be defined to support the type in the iostreams environment.
In general, user-defined character types must meet the requirements of a POD type:
struct Echar { char c; char i; };