Skip to content

Commit

Permalink
Allow async source to take lambda func which capture unique_ptr (face…
Browse files Browse the repository at this point in the history
…bookincubator#8980)

Summary:
Currently async source take a copy of working function which disallow
to pass lambda function which captures unique_ptr. Changes to move
the function in async source ctor to make it work

Pull Request resolved: facebookincubator#8980

Reviewed By: Yuhta

Differential Revision: D54589844

Pulled By: xiaoxmeng

fbshipit-source-id: 83500d97d9f9cbc35a27be8ad236d6e068d0a71f
  • Loading branch information
xiaoxmeng authored and Joe-Abraham committed Jun 7, 2024
1 parent 85b9ebb commit 577f32c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion velox/common/base/AsyncSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ template <typename Item>
class AsyncSource {
public:
explicit AsyncSource(std::function<std::unique_ptr<Item>()> make)
: make_(make) {}
: make_(std::move(make)) {}

// Makes an item if it is not already made. To be called on a background
// executor.
Expand Down

0 comments on commit 577f32c

Please sign in to comment.