C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] Specific Override Specifier
From: Ryan Nicholl (rnicholl_at_[hidden])
Date: 2020-03-18 12:16:06


A non-virtual function can override a virtual function, and vise versa. So virtual can't be deduced.

-------- Original Message --------
On Mar 18, 2020, 10:37, Michał Policht via Std-Proposals 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).
>
> Regards
> Michał
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals



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

Standard Proposals Archives on Google Groups