Uhm, since that's all about terminology I'd better correct it.
Default initialization for a basic type does nothing whatsoever, so
that's not the other-than-nothing that happens for static variables.
Namespace scope variables are automatically /zero-initialized/. That's
the first of three distinct phases of initialization. The following are
PHASES, the three phases are 1.1, 1.2 and 2:
1. /Static initialization/ is performed for variables with static or
thread storage duration, and consists of
1.1 /Zero-initialization/ zeroes variables. Formally it's not
performed for a variable that instead is constant-initialized.
1.2 /Constant initialization/ is where a variable is initialized
with a compile time constant initializer.
2. /Dynamic initialization/ is all other initialization, and happens
after static initialization. The standard differentiates between
unordered, partially ordered and ordered dynamic initialization.
Partially ordered is in C++17 for "an inline variable that is not an
implicitly or explicitly instantiated specialization".
In practice the values of static initialization for static storage
duration can just be part of the executable's image loaded into memory
to run the program.
Anyway, what you intended to write was probably "but static and thread
storage variables are automatically zero-initialized".
Another point: whether one imagines a do-nothing constructor, or that
simply nothing happens, is a point of view. Both views are valid, they
cannot be distinguished by effects. At least I believe so. :-o
> Giving an explicit value of an explict call to the default constructor
> gets you the defined value.
Not sure what that is intended to communicate.
- Alf