The proposal gives its justification by saying (under the "The valueless state and interaction with std::optional" section header):
We provide a valueless_after_move member function that returns true if an object is in a valueless state. This allows explicit checks for the valueless state in cases where it cannot be verified statically.
It also says under the "The valueless_after_move member function" header:
This member function should rarely be called: it should be clear through static analysis whether or not an object has been moved from. The valueless_after_move member function allows explicit checks for the valueless state in cases where it cannot be verified statically or where explicit checks might be required by a coding standard such as MISRA or High Integrity C++.
View all comments
Show parent comment
3
u/ts826848 Aug 14 '26
The proposal gives its justification by saying (under the "The valueless state and interaction with
std::optional" section header):It also says under the "The
valueless_after_movemember function" header: