C++ template
None.
.-TEMPINC---. >>-+-NOTEMPINC-+--+----------------+--------------------------->< '-(--location--)-'
For a PDS directory, the default option is TEMPINC(TEMPINC). For a z/OS® UNIX System Services file system directory, the default option is TEMPINC(./tempinc).
In the z/OS UNIX environment, the template instantiation files are by default produced in a ./tempinc directory when C++ source files are compiled with the TEMPINC option.
When the bind step is invoked, using the c++ or cxx commands, and in the presence of ./tempinc directory, the XL C++ compiler is automatically invoked to compile all template instantiation files in the ./tempinc directory. If the command line only includes binder options, the template instantiation files are compiled using the XL C++ compiler defaults. If this is not appropriate for compiling the template instantiation files, all required XL C++ compiler options must be specified on the command line even though the command line is intended to invoke the bind step.
Automatic invocation of the XL C++ compiler is performed by the c89 utility when using the c++ and cxx commands. The same is true when using C++ invocation commands from the xlc utility, except the xlc utility invokes the bind step using the c89 utility. When the xlc utility invokes the c89 utility for the bind step it only passes the binder options, so the template instantiation files are always compiled with the XL C++ compiler defaults. For this reason, the TEMPINC method for processing template instantiations is not recommended with the xlc utility. The TEMPLATEREGISTRY method should be used instead.
If you do not specify a location, the compiler places all template instantiation files in a default location. If the source resides in a data set, the default location is a PDS with a low-level qualifier of TEMPINC. The high-level qualifier is the userid under which the compiler is running. If the source resides in a z/OS UNIX file, the default location is the z/OS UNIX file system directory ./tempinc.
c++ -Wc,"NOTEMPINC(hello)" -Wc,TEMPINC ./hello.C
c++ -Wc,"TEMPINC(hello)" ./hello.C
c++ -Wc,"NOTEMPINC(hello)" -Wc,"TEMPINC(n1)" -Wc,"NOTEMPINC(test)" -Wc,TEMPINC
./hello.C
c++ -Wc,"TEMPINC(test)" ./hello.C
If you have large numbers of recursive templates, consider using FASTT. See FASTTEMPINC | NOFASTTEMPINC (C++ only) for details.
TEMPINC(xxx)
The IPA link step issues a diagnostic message if you specify the TEMPINC option for that step.
__TEMPINC__ is predefined to 1 when the TEMPINC compiler option is in effect; otherwise it is undefined.