K
Kevin Goodsell
White said:I do not care if a later "giving of a correct value" is called assignment
and not initialization. Just be brave and admit that it is legal to have
uninitialized PODs around
In the sense that the word is usually used, yes. But it's very clear
that the standard (and the people who wrote it) consider
"initialization" to be something that occurs when the object is created.
I suppose you can debate whether or not it *always* occurs when an
object is created, but that's not really relevant to how the language is
used. The most important point is that initialization cannot happen at
some later time. Assignment can, and then the object is considered, for
all intents and purposes, initialized, and usable as an rvalue.
The only part of this debate that is important at all is the fact that
initialization and assignment are different, and mutually exclusive.
(as long as they are not used as an rvalue) and
that it is legal to assign a value to an uninitialized POD, which makes it
initialized. PODs can be initialized "later" than their
definition/construction.
But it's not initialization in the sense that the standard uses it. It
is (pseudo-)initialization in the sense that the object is not longer
considered "uninitialized" (which actually means "indeterminate" in the
common use).
The initialization (giving a correct initial value
and thereby forming a valid POD type T) can be done using an assigment.
I don't know why we are still debating this when the standard is so
clear on it. Show me anywhere in the standard where it is even suggested
that assignment can constitute initialization.
-Kevin