Monday, November 22, 2010

Separation Model of Templates

Using the "export" keyword in a template declaration allows a compilation unit that uses a template to only see the declaration of the template without having to see the definition.

This is part of the Separation Model of Templates. Most people use the Inclusion Model, where the template declaration and definition are both in the header file.

Reference: C++ Templates by David Vandevoorde and Nicolai M. Jouttis. Addison-Wesley, 2003.

No comments:

Post a Comment