C++ Migration Guide

Converting to the New Rules

A problem for migrating code is that typename was not previously a keyword. If existing code uses typename as an identifier, you must first change the name to something else.

For code that must work with old and new compilers, you can add statements that are similar to the following example to a project-wide header file.


#ifdef TYPENAME_NOT_RECOGNIZED
#define typename
#endif

The effect is to conditionally replace typename with nothing. When using older compilers (such as Sun C++ 4.2) that do not recognize typename, add -DTYPENAME_NOT_RECOGNIZED to the set of compiler options in your makefile.