Re: Copy constructors
On 18 Oct, 16:37, Joe Greer <jgr...@doubletake.com> wrote:
> ke...@bytebrothers.co.uk wrote in news:1192721104.884316.307060
> @k35g2000prh.googlegroups.com:
>
> > OK, this makes the warning go away - thanks. Now, what's happening?
> > I thought that by the time we reached Derived's constructor (in this
> > case, copy constructor), Base was guaranteed to have been fully
> > constructed. This result implies I am wrong...
>
> Don't read too much into the syntax. This basically just tells the
> compiler which constructor to use for the base class and provides the
> opportunity to provide parameters to the base class' constructor. By the
> time your Derived member initialization occurs and your constructor body is
> executed, the base class will have been initialized.
Ahhh... My understanding was _nearly_ correct; By the time we reach
Derived's constructor's BODY, Base is guaranteed to have been fully
constructed. But while we are still in the initialisation list, we
can (and apparently should) explicitly call Base's constructor.
Have I got it right now?!
|