This is the mail archive of the
mailing list for the GCC project.
Re: Using C++ in GCC is OK
- From: Robert Dewar <dewar at adacore dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 03 Jun 2010 16:49:01 -0400
- Subject: Re: Using C++ in GCC is OK
- References: <4C030228.firstname.lastname@example.org> <AANLkTimzVEXsE4vOZJuegnHFu-pVyNdKImcasoSX_ZDc@mail.gmail.com> <4C039253.email@example.com> <AANLkTikp-gTh4bCpAFYWhU7fR9tBTxOP6mQp9TAfideB@mail.gmail.com> <4C03EB8D.firstname.lastname@example.org> <email@example.com>
Steinar Bang wrote:
Mark Mitchell <firstname.lastname@example.org>:
I think virtual functions are on the edge; quite useful, but do result
in the compiler adding a pointer to data objects and in uninlinable
indirect calls at run-time. Therefore, I would avoid them in the
initial subset of C++ used in GCC.
Umm...? Virtual functions are _the_ core C++ feature for creating OO
Allowing C++ but avoiding virtual functions seems odd to me.
Not at all, data abstraction and inheritance do not depend on
virtual functions. You can do a lot without allowing dynamic
dispatching. Of course there are some cases where dynamic
dispatching makes things easier, but to regard it as *the*
core feature of C++ seems dubious to me (the STL in general
relies on templates, but not dynamic dispatching as far as