With C++17 we can use std::optional. This is particularly useful for places where we currently do stuff like boolean out parameters that indicate success/failure.
Investigate where those places are and port them
With C++17 we can use std::optional. This is particularly useful for places where we currently do stuff like boolean out parameters that indicate success/failure.
Investigate where those places are and port them
Status | Assigned | Task | ||
---|---|---|---|---|
Open | None | T11551 use C++ modern features | ||
Open | None | T14311 Investigate where std::optional should be used |
Just wanted to drop a word on it. I'm all in favor of Option, Result and other algebraic rusty types. But how is it going to integrate with QML runtime? JS can only meaningfully represent either external nullability or special type-specific internal 'invalid' state using regular methods like 'isValid()' etc. The whole language seem to revolve around the concept of external null/undefined values, which can be seen in the recently added Optional chaining (?.) operator. (idk if it's already there but) special support definitely can be added to the QML/JS engine so that it would convert std::optional back and forth between languages boundary, but of course that raises a usual question: what if Some(null) is a valid state that should be representable?