Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

VIRTUAL_FUNCTION_TAB pragma

&pagelevel(4)&pagelevel

#pragma VIRTUAL_FUNCTION_TAB = {GLOBALLY_DEFINED | EXTERNALLY_DECLARED}


This pragma can be used to control the generation of the virtual function table in C++ mode. This table is generated implicitly if a class has at least one virtual function.

Usually the compiler determines a module which contains the definition of the table. In other modules only an external reference is generated. For this, it is checked whether the class has a virtual function that is neither inline nor a pure virtual function. The module in which the first of these functions is defined is then taken.

However, there are classes for which this heuristic fails. This pragma works for these classes:

  • If the pragma is not specified, the table is created as a static variable.
  • If GLOBALLY-DEFINED is specified, the table is defined as an external variable in this module.
  • If EXTERNALLY-DECLARED is specified, only an external reference to the table is generated. It must then be defined in another module.