Start of change

do_not_instantiate

Start of change C++ compiler only
Read syntax diagramSkip visual syntax diagramdo_not_instantiate syntax
 
>>-#--pragma--do_not_instantiate--template class name----------><
 

Description

Prevents the specified template declaration from being instantiated. You can use this pragma to suppress the implicit instantiation of a template for which a definition is supplied.

Parameters

template_class_name
The name of the template class that should not be instantiated.

Notes on Usage

If you are handling template instantiations manually (that is, compiler options TEMPLATE(*NONE) and TMPLREG(*NONE) are in effect), and the specified template instantiation exists in another compilation unit, using #pragma do_not_instantiate ensures that you do not get multiple symbol definitions during the link step.

Examples

The following example shows the usage of the pragma:

#pragma do_not_instantiate Stack <int>
End of changeEnd of change

[ Top of Page | Previous Page | Next Page | Contents | Index ]