Boost logo

Boost Users :

Subject: [Boost-users] [Process] Help needed with boost::process::extend::on_*
From: Günter Berner (guenterbe_at_[hidden])
Date: 2018-04-26 10:27:22


I am using boost::process::child to create a child process:

boost::process::child child("foo");

This works fine so far (on Linux + Windows).

Now i want to use a handler which is executed during the fork process:

boost::process::child child("foo", boost::process::extend::on_setup =
[](auto& exec) {
// ...
});

This also works fine - as long as a more or less up-to-date C++ compiler or
C++ standard.
Since g++-4.8.5 (which I have to use) does not support auto template
deduction for lambdas, i have to replace the lambda parameter type with a
concrete type.

boost::process::child child("foo", boost::process::extend::on_setup =
[](<WHAT_GOES_HERE?>& exec) {
// ...
});

Boost.Process documentation only uses the modern approach with auto
template deduction. I simply cannot find an example/documentation where the
concrete types are shown.

Thanks.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net