#pragma instantiate

Applies to C++

Description

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

Syntax


Syntax Diagram

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

#pragma instantiate Stack < int >

Notes

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 References

General Purpose Pragmas
#pragma define
#pragma do_not_instantiate
tempinc
templateregistry IBM Copyright 2003