We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
errors::Error::operator bool
1 parent 483fb0b commit 9dcf517Copy full SHA for 9dcf517
include/errors/error.hpp
@@ -66,18 +66,15 @@ class [[nodiscard]] Error {
66
std::string_view message() const;
67
68
/**
69
- * @brief Checks whether the object contains an error.
+ * @brief Checks whether it contains an error or not.
70
* @return `true` if it contains an error, otherwise `false`.
71
*
72
* @code{.cpp}
73
* const auto err = errors::make("unknown error");
74
+ * assert(err);
75
- * // Print "contains error".
76
- * if (err) {
77
- * std::cout << "contains error" << std::endl;
78
- * } else {
79
- * std::cout << "no error" << std::endl;
80
- * }
+ * const auto no_err = errors::nil();
+ * assert(!no_err);
81
* @endcode
82
*/
83
explicit operator bool() const;
0 commit comments