calling base class destructor implicitly from derived classes

Discussion in 'C++' started by Dave, May 16, 2005.

  1. Dave

    Dave Guest

    Hi,

    Does the destructor of a derived class will invoke base class destructor
    implicitly?

    D
    Dave, May 16, 2005
    #1
    1. Advertising

  2. * Dave:
    >
    > Does the destructor of a derived class will invoke base class destructor
    > implicitly?


    Base class destructors are called implicitly.

    Which piece of code does the calling is unspecified.

    --
    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?
    Alf P. Steinbach, May 16, 2005
    #2
    1. Advertising

  3. On 2005-05-16, Dave <> wrote:
    > Hi,
    >
    > Does the destructor of a derived class will invoke base class destructor
    > implicitly?


    Yes. The destructors are called most-derived first, and likewise constructors
    are called most-derived last.

    Cheers,
    --
    Donovan Rebbechi
    http://pegasus.rutgers.edu/~elflord/
    Donovan Rebbechi, May 16, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page