Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrapper function taking exe and args #419

Open
user706 opened this issue Oct 30, 2024 · 2 comments
Open

wrapper function taking exe and args #419

user706 opened this issue Oct 30, 2024 · 2 comments

Comments

@user706
Copy link

user706 commented Oct 30, 2024

How does one write a wrapper function taking boost::process::exe and boost::process::args.

is boost::process::exe even a type? seems not...

What trickery is this?
Thanks.

@user706
Copy link
Author

user706 commented Oct 30, 2024

this does not compile:

#include <boost/process.hpp>
#include <string>

std::string getStdOutFromCommand(const std::decay_t<decltype(boost::process::exe)> &exe, const std::decay_t<decltype(boost::process::args)> &args)
{
    boost::process::ipstream pipe_stream;
    boost::process::child c(exe, args, boost::process::std_out > pipe_stream);
   // ...
}

@klemens-morgenstern
Copy link
Collaborator

Switch to boost.process v2 and use filesystem::path & vector<string>. Seriously, this trickery was a mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants