bkietz commented on code in PR #44477:
URL: https://github.com/apache/arrow/pull/44477#discussion_r1809408353


##########
cpp/src/arrow/result.h:
##########
@@ -294,7 +294,13 @@ class [[nodiscard]] Result : public 
util::EqualityComparable<Result<T>> {
   ///
   /// \return The stored non-OK status object, or an OK status if this object
   ///         has a value.
-  constexpr const Status& status() const { return status_; }
+  constexpr const Status& status() const& { return status_; }
+
+  /// Gets the stored status object, or an OK status if a `T` value is stored.
+  ///
+  /// \return The stored non-OK status object, or an OK status if this object
+  ///         has a value.
+  Status status() && { return status_; }

Review Comment:
   (If status is an error, then there is no stored object to destroy. If status 
is not an error, then it is cheap to construct an ok status to return here)



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to