lidavidm commented on a change in pull request #9547:
URL: https://github.com/apache/arrow/pull/9547#discussion_r580541720
##########
File path: cpp/src/arrow/util/future.h
##########
@@ -493,6 +493,28 @@ class ARROW_MUST_USE_TYPE Future {
});
}
+ /// \brief Implicit constructor to create a finished future from a value
+ Future(ValueType val) : Future() { // NOLINT runtime/explicit
+ impl_ = FutureImpl::MakeFinished(FutureState::SUCCESS);
+ SetResult(std::move(val));
+ }
+
+ /// \brief Implicit constructor to create a future from a Result, enabling
use
+ /// of macros like ARROW_ASSIGN_OR_RAISE.
+ Future(Result<ValueType> res) : Future() { // NOLINT runtime/explicit
Review comment:
IMO, it's probably better to be explicit in code; I'd rather this be
purely to enable those convenience macros.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]