Re: virtual destruction when?

Discussion in 'C++' started by Andrew Koenig, Aug 22, 2003.

  1. Param> In this case the destructor should be virtual cause if it is
    Param> not the Foo Class destructor will not be called but only Base
    Param> class destructor is called.

    Not quite. The correct statement is:

    In this case, the destructor must be virtual. If it is not,
    the behavior is undefined.

    --
    Andrew Koenig,
    Andrew Koenig, Aug 22, 2003
    #1
    1. Advertising

  2. "Param" <> wrote in message
    news:bi72t1$nv7$...
    > Andrew>
    > I have one question ...
    > How can the behaviour be undefined , as the C++ Standard states that

    the
    > base class destructor will be called...


    Incorrect. Section 5.3.5.3 of the standard states that the behaviour is
    undefined.

    > The C++ ARM says that the behaviour is what i have described...
    >


    The C++ ARM is not the standard.

    > Thanks
    > Param


    john
    John Harrison, Aug 23, 2003
    #2
    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.
Similar Threads
  1. ian douglas
    Replies:
    0
    Views:
    1,808
    ian douglas
    Aug 19, 2003
  2. Andrey Tarasevich

    Re: virtual destruction when?

    Andrey Tarasevich, Aug 22, 2003, in forum: C++
    Replies:
    4
    Views:
    536
    John L Fjellstad
    Aug 26, 2003
  3. V Patel
    Replies:
    5
    Views:
    304
    Yahooooooooo
    Jan 30, 2007
  4. BeautifulMind
    Replies:
    7
    Views:
    641
    Ron Natalie
    Feb 8, 2007
  5. oliver
    Replies:
    2
    Views:
    230
    red floyd
    Jul 14, 2011
Loading...

Share This Page