Vax C90-EL SERIES Service Manual Page 134

  • Download
  • Add to my manuals
  • Print
  • Page
    / 216
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 133
Cray Standard C/C++ Reference Manual
In the case where the CC(1) command is given a single source file to compile and
link, all instantiations are done in the single source file and, by default, the used
mode is used and automatic instantiation is suppressed.
6.3 One Instantiation Per Object File
You can direct the prelinker to instantiate each template referenced in the source
into its own object file. This method is preferred over other template instantiation
object file generation options because:
The user of a library pulls in only the instantiations that are needed.
Multiple libraries with the same template can link. If each instantiation is not
placed in its own object file, linking a library with another library that also
contains the same instantiations will generate warnings on some platforms.
Use the -h one_instantiation_per_object option to generate one object
file per instantiation. For more information about this option, see Section 2.5.2,
page 12.
6.4 Instantiation #pragma Directives
Instantiation #pragma directives can be used in source code to control the
instantiation of specific template entities or sets of template entities. There are
three instantiation #pragma directives:
The #pragma _CRI instantiate directive causes a specified entity to
be instantiated.
The #pragma _CRI do_not_instantiate directive suppresses the
instantiation of a specified entity. It is typically used to suppress the
instantiation of an entity for which a specific definition is supplied.
The #pragma _CRI can_instantiate directive indicates that a specified
entity can be instantiated in the current compilation, but need not be. It is
used in conjunction with automatic instantiation to indicate potential sites for
instantiation if the template entity is deemed to be required by the compiler.
The argument to the #pragma _CRI instantiate directive can be any of
the following:
A template class name. For example: A<int>
A template class declaration. For example: class A<int>
114 S217936
Page view 133
1 2 ... 129 130 131 132 133 134 135 136 137 138 139 ... 215 216

Comments to this Manuals

No comments