C++ Logo


Advanced search

Subject: Re: [std-proposals] Specific Override Specifier
From: Ville Voutilainen (ville.voutilainen_at_[hidden])
Date: 2020-03-18 10:18:33

On Wed, 18 Mar 2020 at 16:38, Michał Policht via Std-Proposals
<std-proposals_at_[hidden]> wrote:
> >
> > I'd suggest a different syntax:
> >
> > class A : public B, public C
> > {
> > virtual int B::lock() override;
> > virtual int C::lock() override;
> > };
> >
> > but I've only needed this rarely; I suspect it probably isn't worth the
> > trouble.
> With such syntax you could get rid of `override`, since it can be
> deduced (maybe even `virtual`, but some language rules might prevent this).

The complications begin to reveal themselves when we consider whether
this facility needs to name
an immediate base or not. Going further up the hierarchy, it might
then need to name full paths to
avoid ambiguities. The work-around I wrote doesn't suffer from that problem.

STD-PROPOSALS list run by herb.sutter at gmail.com

Standard Proposals Archives on Google Groups