Skip to content

Commit b6d494d

Browse files
Jeremy Lilleyfacebook-github-bot
authored andcommitted
[future] Minor: std::move() callback in future for the convenience operator case. (pytorch#37861)
Summary: Pull Request resolved: pytorch#37861 ghstack-source-id: 103511066 Test Plan: buck test mode/dev-nosan caffe2/test/... Differential Revision: D21409650 fbshipit-source-id: 6c501963f73590512e426f6806f4530aad618b1a
1 parent 525295e commit b6d494d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch/csrc/utils/future.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class TORCH_API Future final {
130130
}
131131

132132
void addCallback(std::function<void(const Future<T>& future)> cb) {
133-
addCallback([this, cb]() { cb(*this); });
133+
addCallback([this, cb = std::move(cb)]() { cb(*this); });
134134
}
135135

136136
private:

0 commit comments

Comments
 (0)