Re: Call constructor/destructor of base class

From: Alf P. Steinbach (alfps_at_start.no)
Date: 07/07/04


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?


Relevant Pages

  • Re: Generating PDFs with Ada
    ... structure makes usage of the documents very difficult. ... Visual X-Tools is the worst ever IDE made, ... (For those lucky, who never heard about it, X-tools render the source code ...
    (comp.lang.ada)
  • How to start working for developing a virtual printer driver?
    ... They said me to refer to GENPRINT ... ("I haven't changed any of the source code") ... how to write a INF and GPD... ...
    (microsoft.public.development.device.drivers)
  • Re: how to fix unresolved symbols
    ... I have access to the source code for that library, ... There's an inline function (in his case, a constructor from the looks ... of it) with an implementation in a .cpp source file, ... as the function declaration/definition (due to default args being omitted ...
    (alt.comp.lang.learn.c-cpp)
  • Re: instantiate a class using reflection issue
    ... non default constructor. ... I am trying this idea on nunit sample source code. ... System.Type typef14CHF = ... Why do you specify the name of the interface instead of the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: [SLE] Online updates & compiling
    ... They refer to the local copy of the rpm YOU douwnloaded and ... Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com ...
    (SuSE)