C++ Logo

std-proposals

Advanced search

Re: Specific Override Specifier

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Wed, 18 Mar 2020 17:18:33 +0200
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.

Received on 2020-03-18 10:21:33