A
Alf P. Steinbach
* Karl Heinz Buchegger:
It does; see above. Note in particular that "without any argument" can
not refer to a generated call. So it must refer to a source code call.
(In fact that's the point of that particular paragraph: if you
provide default values for all arguments of a constructor, then
it becomes a default constructor because then it "can be called
without an argument" in the source code; the paragraph is simply
a definition of what a default constructor is, based on how it can
be called in the source code.)
"Multiple explanation marks are a true sign of a diseased mind"
(Terry Pratchett)
Alf P. Steinbach said:* Karl Heinz Buchegger::
* Karl Heinz Buchegger:
:
There are numerous such places in the standard. But to avoid any
misunderstanding, let me first state categorically that this does _not_
mean I think "otherwise" re your example above. Let me repeat that: it
does not mean that I, or the standard, thinks "otherwise" re your example
above. Wrt. your example above you have correct understanding. Now (if
that's OK?) see e.g. §12.1/5, "a default constructor for a class X is a
constructor of class X that can be called without without an argument".
That doesn't answer my question, since it doesn't say how I (the programmer)
have to code a call to a constructor. It merly says: It can be called, eg.
during the process of creating an object, a constructor may be called.
You ignore the part of that very short quote which was the reason I
carefully selected it for you.
It says the default constructor can be called _without an argument_, and
that is necessarily a source code explicit call:
How come?
You happily snipped the explanation, here it is again:
<quote>
[the phrasing "without an argument"] does not make sense in
generated code, which must supply any arguments in the argument
list.
</quote>
It seems you have a habit of not seeing things you don't like.
Note: the word "explicit" means the opposite of "implicit".
If the object construction is done without arguments the compiler
can use the default constructor. That's all the above is saying.
No, it says, quote: "can be called without an argument".
But it doesn't say by whom.
It does; see above. Note in particular that "without any argument" can
not refer to a generated call. So it must refer to a source code call.
(In fact that's the point of that particular paragraph: if you
provide default values for all arguments of a constructor, then
it becomes a default constructor because then it "can be called
without an argument" in the source code; the paragraph is simply
a definition of what a default constructor is, based on how it can
be called in the source code.)
And that is the whole point!!!!!!!!
"Multiple explanation marks are a true sign of a diseased mind"
(Terry Pratchett)