Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

instantiate_inline pragma

&pagelevel(4)&pagelevel



#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

f

a member function name

A::f

a variable name

i

a static data member name

A::i

a function declaration

void f(int, char)

a member function declaration

void A::f(int, char)

a variable declaration

int i

static data member declaration

int A::i

a class specifier

class A

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.