Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > C++ code > Generating C++ code > Generating C++ code > Modeling C++ code in Modeler > Setting up template class specializations for generating C++ code (C++ code)
  
Setting up template class specializations for generating C++ code (C++ code)
For information about a template class specializations, see Cpprev Template class and template class specialization mapping.
You can set up Template Class Specializations for Template Classes, Data Types, Interfaces and Signals that are present or absent from the Model.
To set up a Template Class Specialization (Template Class present in Model):
1. Create the Template Class and specify its formal parameters:
a. On a Class Diagram, create a Class, Data Type, Interface or Signal and name it as required.
b. Open the Property Pages for the item.
c. On the Options tab, select the Template check box.
d. In the Formal Template Parameters text box, type the formal parameters, delimiting each Parameter with a comma.
2. Create a Template Class Specialization and specify its actual parameters:
a. On the Class Diagram, create a Class, Data Type, Interface or Signal and name it as required.
* 
The name of the item is irrelevant, but we recommend that you use the name the Template Class and the Specialization parameters in angle brackets, for example, vector<float>.
b. Open the Property Pages for the item.
c. On the Options tab, select the Template Specialization check box.
d. Ensure that the Template Specialization Parameters box is blank.
3. Create the abstraction Dependency:
a. On the Class Diagram toolbar, click the Abstraction Dependency button.
b. Click the Template Specialization item you created in Step 2.
c. Click the Template Class you created in Step 1.
d. Apply the «C++ Dependency» stereotype to the Dependency.
For information about applying Stereotypes to an item, see Applying a Stereotype to a model item.
e. Set the tagged value of the C++ Specialization Parameters tag definition (applied by the «C++ Dependency» stereotype) to the value of the specialization parameters.
f. Set the tagged value of the C++ In Implementation tag definition (applied by the «C++ Dependency» stereotype) to FALSE.
To set up a Template Class Specialization (Template Class absent from Model):
1. On the Class Diagram, create a Class, Data Type or Interface
2. Set the Name of the item to that of the template class that is not present in the Model. You can suffix the name with the specialization parameters in angle brackets, for example, vector<float>.
3. Open the Property Pages for the Class, Data Type or Interface.
4. On the Options tab, select theTemplate check box.
5. Ensure that the Template Specialization Parameters box is blank.
6. Apply the «C++ Class» stereotype to the Class, Data Type or Interface.
For information about applying Stereotypes to an item, see Applying a Stereotype to a model item.
7. Set the tagged value of the C++ Specialization Parameterstag definition (applied by the «C++ Class» stereotype) to the value of the specialization parameters.
8. Set the tagged value of the C++ Header Include tag definition (applied by the «C++ Class» stereotype) to #include the template class, for example, #include "vector.h".