Re: Call constructor/destructor of base class
From: Alf P. Steinbach (alfps_at_start.no)
Date: 07/07/04
- Next message: Markus Dehmann: "Re: Exception stack trace"
- Previous message: Ioannis Vranos: "Re: C++/CLI standard"
- In reply to: Karl Heinz Buchegger: "Re: Call constructor/destructor of base class"
- Next in thread: Karl Heinz Buchegger: "Re: Call constructor/destructor of base class"
- Reply: Karl Heinz Buchegger: "Re: Call constructor/destructor of base class"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 07 Jul 2004 13:37:44 GMT
* Karl Heinz Buchegger:
> "Alf P. Steinbach" wrote:
> >
> > * Karl Heinz Buchegger:
> > > "Alf P. Steinbach" wrote:
> > > >
> > > > * Karl Heinz Buchegger:
> > > > > "Alf P. Steinbach" wrote:
> > > > > >
> > > > > > 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) ;)
-- A: Because it messes up the order in which people normally read text. Q: Why is it such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?
- Next message: Markus Dehmann: "Re: Exception stack trace"
- Previous message: Ioannis Vranos: "Re: C++/CLI standard"
- In reply to: Karl Heinz Buchegger: "Re: Call constructor/destructor of base class"
- Next in thread: Karl Heinz Buchegger: "Re: Call constructor/destructor of base class"
- Reply: Karl Heinz Buchegger: "Re: Call constructor/destructor of base class"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|