Skip to content

Commit

Permalink
reactor: use mutable to make std::move() work.
Browse files Browse the repository at this point in the history
Here we use capture-by-value and thus the generated operator()
from lambda is const, making std::move(captured-value) not work.
Now we make the lambda mutable to allow mutating captured value.

Signed-off-by: Jianyong Chen <baluschch@gmail.com>
  • Loading branch information
balusch authored and avikivity committed Jan 8, 2023
1 parent e33b405 commit a4e1508
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/reactor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,7 @@ reactor::spawn(std::string_view pathname,
argv = std::move(argv),
env = std::move(env), this] (std::tuple<file_desc, file_desc> cin_pipe,
std::tuple<file_desc, file_desc> cout_pipe,
std::tuple<file_desc, file_desc> cerr_pipe) {
std::tuple<file_desc, file_desc> cerr_pipe) mutable {
return do_with(pid_t{},
std::move(cin_pipe),
std::move(cout_pipe),
Expand Down

0 comments on commit a4e1508

Please sign in to comment.