C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] Specific Override Specifier
From: Ryan Nicholl (rnicholl_at_[hidden])
Date: 2020-03-19 12:59:37


I would go the other way around:

using B::lock = lock_mutex();

Also, the I believe the parameters need to be included if not the return type.

Or better,

using override B::lock = lock_mutex();

Or maybe

using B::lock override = lock_mutex();

As the last one might have less syntax conflict potential. Could "using override X = Y;" cause a conflict? I prefer the first version if not.

-------- Original Message --------
On Mar 19, 2020, 12:31, Michał Policht via Std-Proposals wrote:

> Or... One could think about extending existing `using` syntax to allow
> for aliasing of not only types [1]
>
> ```
> class A: public B, public C
> {
> using lock_mutex = B::lock;
> using lock_device = C::lock;
>
> int lock_mutex() override;
> int lock_device() override;
> }
> ```
>
> ^^
> Maybe above scenario should be shown in the proposal.
>
> [1]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0945r0.html
>
> Regards
> Michał
>
>> I would suggest a better syntax would reuse the = operator as used in
>> constructors now:
>>
>> virtual int lock_mutex() = int B::lock();
>> virtual int lock_device() = int C::lock();
>>
>>
> --
> 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