C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] Language Feature for Reducing Duplicated Code
From: Ville Voutilainen (ville.voutilainen_at_[hidden])
Date: 2020-07-22 05:14:15


On Wed, 22 Jul 2020 at 12:38, Gašper Ažman via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> Isn't it wonderful that deducing this makes the above SO much easier to do?

Does it? an operator[] needs to be a non-static member function, and a
deduced-this function isn't.

>> T & operator[](size_t i) &;
>> const T & operator[](size_t i) const &;
>> T && operator[](size_t i) &&;
>> const T && operator[](size_t i) const &&;


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

Standard Proposals Archives on Google Groups