Re:C++20, How Hard Could It Be
by int_19h on Sunday September 25, 2022 @07:45PM
(#32977680)
In a language like C++ returning status codes means that callers can and will ignore it, even when they shouldn't.
[ Parent
| on HN ]
Re:C++20, How Hard Could It Be
by zetafunction on Sunday September 25, 2022 @08:52PM
(#32978127)
Since C++17, using [[nodiscard]] can help with that.
Re:C++20, How Hard Could It Be
by jandrewrogers on Sunday September 25, 2022 @09:20PM
(#32978302)
Indeed, Google's implementation of Status/StatusOr requires explicit handling of those objects, they cannot be discarded automatically.