§8.5/6 in draft N3797 says:
To zero-initialize an object or reference of type T means:
- ...
- if T is a reference type, no initialization is performed.
I'd like to have an example of a reference that is zero-initialized.
Later the standard says "Every object of static storage duration is zero-initialized at program startup before any other initialization takes place." So if you have e.g. in global scope
int x;
int& r = x;
r is first zero-initialized, and then initialized by x. For reference, zero-initialized means nothing, so it is mere technicality.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With