This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc home page
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Gerald Pfeifer <gerald at pfeifer dot com>
- Cc: Jurgis Upenieks <afla998 at gmail dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Sun, 2 Jun 2013 22:57:44 +0100
- Subject: Re: gcc home page
- References: <CACnX7OGaYj56YkJ7bbUcc57GU6AHrjw3kcYo9D7xt309k=UM+g at mail dot gmail dot com> <CAH6eHdSouO09SDmEFmgJYtjDT9hQpUqdwk3qmhtoqQMiPPB3mw at mail dot gmail dot com> <alpine dot LNX dot 2 dot 00 dot 1306022004140 dot 2019 at tuna dot site>
On 2 June 2013 19:06, Gerald Pfeifer wrote:
> On Fri, 26 Apr 2013, Jonathan Wakely wrote:
>> On 26 April 2013 13:09, Jurgis Upenieks wrote:
>>> I think that I have found a bug in gcc home page gcc-4.7 changes.
>>> In C++ paragraph about explicit override control.
>>> In example code, is it really struct, not class?
>> Yes, that's valid C++, the example is fine.
>
> I guess the alternative way to write this, using class instead of
> struct, is the following (which needs an extra protected).
Generally in that context protected access would be wrong, it would
mean you can't call the virtual functions on the base class, which
usually defeats the purpose of having virtual functions.
To be equivalent to the original code you'd want 'public', but you'd
also want to add it to the base classes, so that they are
publicly-derived, but doing so adds additional keywords to the example
that contribute nothing.
> Should we go with this, Jonathan? What do you think?
I think the example is fine as is and doesn't need to change.