#pragma instantiate

C++ only


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


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

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

#pragma instantiate Stack < int >


Use this pragma if you are migrating existing code. New code should use standard C++ explicit instantiation.

If you are handling template instantiations manually (that is, -qnotempinc and -qnotemplateregistry are specified), using #pragma instantiate will ensure that the specified template instantiation will appear in the compilation unit.

Related information