Date: Sat, 18 Apr 2026 17:43:25 +0200
> On Apr 18, 2026, at 5:14 PM, Muneem via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> For references, it is to point to a single object for it's whole life time(that is if references do have a lifetime)
I do agree with this statement. However, if you would’ve read the existing std::optional<T&> proposal you would know that this view is not shared among the entire C++ community. Specifically for the optional, people would want to reassign the optional to point to something different. I take from the existing proposal that most implementations of optional that predate the standard allow reassignment and that this is used in production code.
There are good reasons for this view even if you (and I) don’t share them.
And I don’t see a point in trying to convince everybody to think otherwise. I feel like this discussion is already mostly over. And even if I don’t like the outcome, I’d advocate for the same kind of behavior for std::variant<Ts&…> because it is more important to be consistent than to be right (in cases where there is not absolute right or wrong).
>
> For references, it is to point to a single object for it's whole life time(that is if references do have a lifetime)
I do agree with this statement. However, if you would’ve read the existing std::optional<T&> proposal you would know that this view is not shared among the entire C++ community. Specifically for the optional, people would want to reassign the optional to point to something different. I take from the existing proposal that most implementations of optional that predate the standard allow reassignment and that this is used in production code.
There are good reasons for this view even if you (and I) don’t share them.
And I don’t see a point in trying to convince everybody to think otherwise. I feel like this discussion is already mostly over. And even if I don’t like the outcome, I’d advocate for the same kind of behavior for std::variant<Ts&…> because it is more important to be consistent than to be right (in cases where there is not absolute right or wrong).
Received on 2026-04-18 15:43:38
