External Serialization of Templates and Nested Classes
The Serialization package does not have direct support for external serialization of template classes; however, template instances, nested classes, and any class type whose name is more than a simple identifier can be handled with typedefs.
In an earlier example, a nested class was used with a typedef of the form:
 
typedef residential::room residential_room;
This typedef was then used in the macro invocations.
The same can be done with template classes, but serialization support must be provided for each template specialization separately, regardless of whether that specialization is explicit or implicit.
In the example in Templates typedefs were used in the invocations of RW_DEFINE_EXTERNAL_STREAMABLE_POINTER. The typedefs looked like this:
 
typedef t_pet_door<cat> cat_door;
typedef t_pet_door<monkey> monkey_door;
These can also be used with RW_DECLARE_EXTERNAL_STREAM_FNS.
 
RW_DECLARE_EXTERNAL_STREAM_FNS(cat_door)
RW_DECLARE_EXTERNAL_STREAM_FNS(monkey_door)