Re:C++20, How Hard Could It Be
by mrazomor on Sunday September 25, 2022 @03:06PM
(#32974839)
"no exceptions" is one of the best parts of Google style guide, IMO. Note that, banning of exceptions introduced returning status (error codes done right). It makes it easier to follow the code and makes the code more readable (but, you need a few macros, unfortunately).
[ Parent
| on HN ]
In a language like C++ returning status codes means that callers can and will ignore it, even when they shouldn't.
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.