C++ Logo

std-proposals

Advanced search

Re: [std-proposals] New access specifiers

From: Robin Savonen Söderholm <robinsavonensoderholm_at_[hidden]>
Date: Mon, 16 Dec 2024 15:12:13 +0100
Not to say that I immediately support this request, but Python actually
have something like this through its @property and @<property name>.setter
syntax. (To answer the question if another language already have this)


// Robin

On Mon, Dec 16, 2024, 15:05 Andre Kostur via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> Why would a “classical getter” necessarily return by value? (Sure: a
> naive code generator might write one, but that’s a different issue)
>
> On Mon, Dec 16, 2024 at 5:26 AM Sebastian Wittmeier via Std-Proposals <
> std-proposals_at_[hidden]> wrote:
>
>> Fair enough.
>>
>> But with the difference that a classical getter would be by value and
>> that one would return a const reference.
>>
>>
>> -----Ursprüngliche Nachricht-----
>> *Von:* Robin Savonen Söderholm <robinsavonensoderholm_at_[hidden]>
>> *Gesendet:* Mo 16.12.2024 13:33
>> *Betreff:* Re: [std-proposals] New access specifiers
>> *An:* std-proposals_at_[hidden];
>> *CC:* Sebastian Wittmeier <wittmeier_at_[hidden]>;
>>
>> That would be a getter, which the OP was trying to avoid... I guess the
>> OP would like to declare things that looks like 'member fields' but in
>> reality are 'member functions'. Not sure how that would end up though.
>>
>> // Robin
>>
>> --
>> Std-Proposals mailing list
>> Std-Proposals_at_[hidden]
>> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2024-12-16 14:12:26