#pragma
instantiate_inline
argument
Extern inline functions and inline variables must be assigned to a module. The source gives no hint on which module to use. So the compiler chooses one. With this pragma the programmer can choose the module.
The external entry for the symbol will be placed in this module. For extern inline functions it will be needed when the address is taken or when the optimizer decides not to do inline expansion.
For inline variables the current module will contain the memory for the variable.
The following arguments can be specified with the pragma:
Argument | Examples |
a function name |
|
a member function name |
|
a variable name |
|
a static data member name |
|
a function declaration |
|
a member function declaration |
|
a variable declaration |
|
a static data member declaration |
|
a class specifier |
|
When a class name is specified as an argument, the net effect is the same as if the pragma were specified for each member function and for each static data member of that class.
If a function name or member function name (e.g. A::f
) is specified as a pragma argument, it must not be an overloaded function. Overloaded functions or member functions can be specified by providing the complete function declaration, as in #pragma instantiate_inline char * A::f(int, char *).
The argument to an instantiation pragma may not be a compiler-generated function or a pure virtual function.
The argument may not be a template. For templates use an explicit instantiation or the #pragma instantiate
.
This pragma is available in C/C++ version 4.0A20 or later.