You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As std::optional has been required to propagate copy/move triviality, a pointer data member that always points to the contained value cannot be a viable implementation strategy if any of copy/move triviality is propagated.
Can we eliminate val and just use "the contained value" (or its address) instead?
The text was updated successfully, but these errors were encountered:
We could replace val->~T() with value().~T(), and talk about the state of value() instead of *val. And in the accessors that return val or *val we could talk about "the contained value". I think that could work, but it probably needs LWG review (or even an LWG issue).
frederick-vs-ja
changed the title
[optional.optional] Can we eliminate the exposition only member val?
LWG4015 [optional.optional] Can we eliminate the exposition only member val?
Nov 25, 2023
As
std::optional
has been required to propagate copy/move triviality, a pointer data member that always points to the contained value cannot be a viable implementation strategy if any of copy/move triviality is propagated.Can we eliminate
val
and just use "the contained value" (or its address) instead?The text was updated successfully, but these errors were encountered: