PragmaTwice commented on code in PR #33912:
URL: https://github.com/apache/arrow/pull/33912#discussion_r1091365421


##########
cpp/src/arrow/result.h:
##########
@@ -371,7 +371,7 @@ class [[nodiscard]] Result : public 
util::EqualityComparable<Result<T>> {
     if (ok()) {

Review Comment:
   Thank for your reviews and suggestions!
   
   But I want to point out that there are some difference between 
`Result::ValueOrElse` and `std::optional::or_else`: `Result<T>::ValueOrElse` 
returns a value typed `T`, while `std::optional<T>::or_else` typed 
`std::optional<T>`, so that the generator in `std::optional::or_else` can 
returns something like `std::nullopt` and then the `or_else` operations can be 
"chained" (e.g. `v.and_then().or_else().transform()`) and more expressive to 
achieve "monadic".



-- 
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