The above examples are possible because the Typeof Library knows about primitive
types, such as int, double, char,
etc. The Typeof Library also knows about most types and templates defined by
the Standard C++ Library, but the appropriate headers need to be included to
take advantage of this:

If your define your own type, the Typeof Library cannot handle it unless you
let it know about this type. You tell the Typeof Library about a type (or template)
by the means of "registering" this type/template.

Any source or header file where types/templates are registered has to contain
the following line before any registration is done:

#includeBOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()

After this a type can be registered:

namespaceex6{structMyType{};}BOOST_TYPEOF_REGISTER_TYPE(ex6::MyType)

The registration must be done from the context of global namespace; fully qualified
type name has to be used.

Any number of types can be registered in one file, each on a separate line.

Once your type is registered, the Typeof Library can handle it in any context: