The init_priority variable attribute (C++ only)

The variable attribute init_priority is an extension to C++ that allows you to control the initialization order of static objects defined in namespace scope across multiple compilation units.

Read syntax diagramSkip visual syntax diagraminit_priority variable attribute syntax
 
>>-__attribute__------------------------------------------------>
 
>--((--+-------------------+--+-------------------------+--))--><
       +-init_priority-----+  '-(--relative_priority--)-'
       '-__init_priority__-'
 

The relative_priority is a constant integral expression between 101 and 65535, inclusive. A lower number indicates a higher priority.

Related information