#pragma do_not_instantiate

C++ only

Description

The #pragma do_not_instantiate directive instructs the compiler to not instantiate the specified template declaration.

Syntax

Read syntax diagramSkip visual syntax diagram>>-#--pragma--do_not_instantiate--template---------------------><

where template is a class template-id. For example:

#pragma do_not_instantiate Stack < int >

Notes

Use this pragma to suppress the implicit instantiation of a template for which a definition is supplied.

If you are handling template instantiations manually (that is, -qnotempinc and -qnotemplateregistry are specified), and the specified template instantiation already exists in another compilation unit, using #pragma do_not_instantiate ensures that you do not get multiple symbol definitions during link-edit step.

Related information