Why optional is my new favorite feature in C++
HTML-код
- Опубликовано: 28 сен 2024
- I recently came across the feature of optional in c++, and it is a feature I have liked so much, that I decided to make a video about it, as it allows me to write more clear and easy-to-understand functions.
great video, i learn a lot
Optional doesnt replace result though, is there something in c++ that mimicls rust's result?
That is true, as optional doesn't return an error type, only whether or not there is a value. To my knowledge, this is the closest I have seen so far, but I would not be suprised if there are even better solutions.