TEMPLATEREGISTRY | NOTEMPLATEREGISTRY (C++ only)

Category

C++ template

Pragma equivalent

None.

Purpose

Maintains records of all templates as they are encountered in the source and is designed to ensure that only one instantiation of each template is made.

Syntax

Read syntax diagramSkip visual syntax diagram
   .-NOTEMPL-.                       
>>-+-TEMPL---+--+----------------+-----------------------------><
                '-(registryFile)-'   

Defaults

NOTEMPLATEREGISTRY

Parameters

registryFile
The location for template registry information. The default location is dependent on the OE compiler option. When a template registry file is in a sequential data set file, all compilations of a given application must be sequential otherwise two different compilations might need access to the same sequential data set file at the same time. This can cause a collision leading to incorrect compilation results. For parallel builds, use a z/OS® UNIX file as the template registry file.

Usage

When the TEMPLATEREGISTRY compiler option is in effect, and the compiler encounters a reference to a template instantiation for the first time, the instantiation is generated and the related object code is placed in the current object file. Any further references to identical instantiations of the same template in different compilation units are recorded but the redundant instantiations are not generated.

No special file organization is required to use the TEMPLATEREGISTRY option. If you do not specify a location, the compiler places all template registry information in a default location. If the NOOE compiler option is in effect, the default location is a sequential data set that has a high-level qualifier that is the userid under which the compiler is running, with .TEMPLREG appended as the low-level qualifier. If the OE compiler option is in effect, the default location is the z/OS UNIX file ./templreg. If a file currently exists with the name of the file name used for TEMPLATEREGISTRY, then that file will be overwritten. For more information on using the TEMPLATEREGISTRY option, see z/OS XL C/C++ Programming Guide.

Note: TEMPINC and TEMPLATEREGISTRY cannot be used together because they are mutually exclusive. If you specify TEMPLATEREGISTRY, then you set NOTEMPINC. If you use the following form of the command in a JES3 batch environment where xxx is an unallocated data set, you may get undefined results.
TEMPLREG(xxx)

IPA effects

The IPA link step issues a diagnostic message if you specify the TEMPLATEREGISTRY option for that step.

Predefined macros

None.