| United States-English |
|
|
|
![]() |
HP Itanium-based Systems: HP aC++/HP C Programmer's Guide > Chapter 2 Command-Line OptionsTemplate Options |
|
By using a template option on the aCC command line, you can:
The +[no]dep_name option enforces strict dependent-name lookup rules in templates. The default is +dep_name. +inst_compiletime The +inst_compiletime option causes the compiler to use the compile time (CTTI) instantiation mechanism to instantiate templates. This occurs for every template used or explicitly instantiated in this translation unit and for which a definition exists in the translation unit. This is the default.
+inst_directed The +inst_directed option indicates to the compiler that no templates are to be instantiated (except explicit instantiations). If you are using only explicit instantiation, specify +inst_directed. The following example compiles file.C with the resulting object file containing no template instantiations, except for any explicit instantiations coded in your source file. aCC +inst_directed prog.C See Chapter 5 “Using HP aC++ Templates” for more information.
+inst_implicit_include The +inst_implicit_include option specifies that the compiler use a process similar to that of the cfront source rule for locating template definition files. For the cfront based HP C++ compiler, if you are using default instantiation (that is, if you are not using a map file), you must have a template definition file for each template declaration file, and these must have the same file name prefix. This restriction does not apply in HP aC++. Therefore, if your code was written for HP C++ and you wish to follow this rule when compiling with HP aC++, you need to specify the +inst_implicit_include option. This option is strongly discouraged and the sources should be modified to conform to the standard. Example: aCC +inst_implicit_include prog.C If prog.C includes a template declaration file named template.h, the compiler assumes a template definition file name determined by the +inst_include_suffixes option. See Chapter 5 “Using HP aC++ Templates” for more information.
+inst_include_suffixes "list" The +inst_include_suffixes option specifies the file name extensions that the compiler uses to locate template definition files. This option must be used with the +inst_implicit_include option. list is a set of space separated file extensions or suffixes, enclosed in quotes, that template definition files can have. The default extensions in order of precedence are:
User-specified extensions must begin with a dot and must not exceed four characters in total. Any extension that does not follow these rules causes a warning and is ignored. These restrictions do not apply in HP aC++. Therefore, if your code was written for HP C++ and you wish to follow the cfront-based HP C++ template definition file naming conventions when compiling with HP aC++, you need to specify the +inst_include_suffixes option. The following example specifies that template definition files can have extensions of .c or .C: +inst_include_suffixes ".c .C" The +inst_include_suffixes option is equivalent to the HP C++ -ptS option. See Chapter 5 “Using HP aC++ Templates” for more information.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||