Given a type with dual index domains, in particular sequential numbers and character strings, and where we wish to lookup using either domain, so that there are two useful values for id(), the sequence and hash numbers, the Dual class template provides a cyclical wrapping that:

- conserves type information, so the original type can be recovered; and
- redefines the operator<() relation to the identifier hash code, so that the wrapper sorts in hash order, and supports indexed lookup via the label text.

Note that the template type T must have a data member named 'name' itself having member function id(). The type T is typically an identifier or string.

Although the finite domains are the common case of dual types, the Dual template is also used for the Relation class.

Bill Pippin 2010-01-14