C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Proposal for std::optional extensions

From: Giuseppe D'Angelo <giuseppe.dangelo_at_[hidden]>
Date: Mon, 10 Jun 2024 14:15:06 +0200
On 10/06/2024 00:54, Jason McKesson via Std-Proposals wrote:
>>
>> Again, you are completely right.
>> I guess what I want is that in the case of pointer-to-member-data the member would be copied to the new optional.
>> But this would mean that the semantics differ from those of std::invoke which makes it harder to argue for.
> More importantly, it would take up design space in the event that
> `optional<T&>` came into existence.

In fact, I'm not sure why P2988 doesn't change the monadic functions for
std::optional so that they return optional<T &>.

My 2 c,
--
Giuseppe D'Angelo

Received on 2024-06-10 12:15:12