felipecrv commented on code in PR #42094:
URL: https://github.com/apache/arrow/pull/42094#discussion_r1635659154


##########
cpp/src/arrow/result.h:
##########
@@ -288,7 +288,7 @@ class [[nodiscard]] Result : public 
util::EqualityComparable<Result<T>> {
   constexpr bool ok() const { return status_.ok(); }
 
   /// \brief Equivalent to ok().
-  // operator bool() const { return ok(); }
+  constexpr explicit operator bool() const { return ok(); }

Review Comment:
   The explicit way of converting to `bool` is simply calling `ok()`.
   
   `if (result.ok()) { }`, that's all.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to