Initialization

Initialization of a variable provides its initial value at the time of construction.

# Notes

The order of destruction of non-local variables is described in std::exit.

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
CWG 270C++98the order of initializing static data membersof class templates was unspecifiedspecified as unordered except forexplicit specializations and definitions
CWG 441C++98non-local references with static storage duration werenot always initialized before dynamic initializationsconsidered as static initialization, alwaysinitialized before dynamic initializations
CWG 1415C++98a block-scope extern variabledeclaration could be a definitionprohibited (no initializerallowed in such declarations)
CWG 2599C++98it was unclear whether evaluating functionarguments in the initializer is part of initializationit is part of initialization

# See also