Skip to content

Commit 9dcf517

Browse files
committed
docs(api): update the API documentation of errors::Error::operator bool method
1 parent 483fb0b commit 9dcf517

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

include/errors/error.hpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,15 @@ class [[nodiscard]] Error {
6666
std::string_view message() const;
6767

6868
/**
69-
* @brief Checks whether the object contains an error.
69+
* @brief Checks whether it contains an error or not.
7070
* @return `true` if it contains an error, otherwise `false`.
7171
*
7272
* @code{.cpp}
7373
* const auto err = errors::make("unknown error");
74+
* assert(err);
7475
*
75-
* // Print "contains error".
76-
* if (err) {
77-
* std::cout << "contains error" << std::endl;
78-
* } else {
79-
* std::cout << "no error" << std::endl;
80-
* }
76+
* const auto no_err = errors::nil();
77+
* assert(!no_err);
8178
* @endcode
8279
*/
8380
explicit operator bool() const;

0 commit comments

Comments
 (0)