Loading...
Select Version
&pagelevel(4)&pagelevel
The language modes C++ 2017 and C++ 2020 support extern inline functions (see "extern inline vs. static inline"). They have a similar problem as template units: a single address. The function must be assigned to a single module.
Extern inline functions are handled mostly like template units. They will get an entry in the instantiation information file. The automatic instantiation assignes the function to a module.
The effect is that automatic instantiation has to be performed even when no template is used.
Inline expansion is still possible, see “Inline substitution of user-defined functions” (The optimization process ). This optimization is possible in all modules.
Extern inline functions differ from template units:
- The pragmas
instantiate
,do_not_instantiate
undcan_instantiate
may not be used for non-template extern inline functions. - The pragma
instantiate_inline
can be used to assign an extern inline function to a specific module. - Implicit inclusion is not relevant. All types used in an extern inline function must have been declared. This is the same as for other functions.
- An extern inline function is checked in each module where it is defined.
- The current compiler (version 4.0B03) does not put extern inline functions into ETR files.