This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Unexpected C++ program result
- From: klperez <klperez97 at yahoo dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 9 May 2012 12:11:37 -0700 (PDT)
- Subject: Re: Unexpected C++ program result
- References: <CAHbtX-t1Q+N5it3DpYtzPEfW9C45MeVJ5qv9Rbhjw3Bk_W2fZg@mail.gmail.com> <33763652.post@talk.nabble.com>
klperez wrote:
>
> Hello Mattia, I am glad your question was sort of answered. Given his
> answer it seems to me that gcc breaks the rules of polymorphism, because
> it does not allow multiple inherited objects to be treated like their base
> class. Clearly one should not have Final objects be stored in a
> dynamically allocated array of base classes, but is there a way to store
> them in a different way without leaking memory? For example could one use
> a std vector, which stores three Final objects, and then calls clear when
> it comes time to delete them?
>
> Sorry for hijacking your question, and I hope that someone is able to
> answer.
>
> Kevin
>
--
View this message in context: http://old.nabble.com/Unexpected-C%2B%2B-program-result-tp33280210p33763653.html
Sent from the gcc - Help mailing list archive at Nabble.com.