Template Compiler Switches

From RAD Studio
Jump to: navigation, search

Go Up to Compiler Template Switches Index

The -Jg family of compiler switches for BCC32 control how instances of templates are generated by the compiler. Every template instance encountered by the compiler will be affected by the value of the switch at the point where the first occurrence of that particular instance is seen by the compiler.

For template functions, the switch applies to the function instances; for template classes, it applies to all member functions and static data members of the template class. In all cases, this switch applies only to compiler-generated template instances and never to user-defined instances. It can be used, however, to tell the compiler which instances will be user-defined so that they are not generated from the template.

-J    Template generation options
-Jgd  Generate definitions for all template instances and merge duplicates
-Jgx  Generate external references for all template instances

You can set template generation options in either of two ways:

See Also