Examples
Here is a sample use of different visitor objects using the same visit methods for class Foo. The visitor code is not presented here.

A Structured Data Dumper
A structured data visitor writes a human-readable representation to an ostream.

XVF_Dump_Out<ostream> xvf(cout);
Foo p(1, 2);

xvfv << p;

An Archiver
An archiver visitor writes a machine-readable representation to an ostream.

XVF_Archive_Out<ostream> xvfv(cout);
Foo p(1, 2);

xvfv << p;

XML I/O
An XML output visitor writes objects as an XML stream.

XVF_XML_Out<ostream> xvfv(cout);
Foo p(1, 2);

xvfv << p;

An XML input visitor reads an XML stream into a object.

XVFV_XML_In<istream> xvfv(cin);
Foo p;

xvfv >> p;

Dynamic GUI generation
An inspector visitor generates TCL/TK code to create an inspector GUI.

Tcl_Interp *interp;
XVF_TK_Inspector xvfv(interp);
Foo p(1, 2);

xvfv << p;

TK widget generated by XVF_TK_Inspector.
TK widget generated by XVF_TK_Inspector.

Reflective Accessors

XVF_Getter xvfg;
Foo p(1, 2);
double py;

xvfg(&p, xvf_type(&p), "y", &py); // py = p.y

XVF_Setter xvfs;
xvfs(&p, xvf_type(&p), "x", &py); // p.x = py

XDR Bridge

XDR *xdr;
XVF_XDR xvfv(xdr);

xvfv << p;