3
因此,我想,雖然它並沒有被接納進入Boost發佈尚未做一些與Boost.Process。Boost.Process - 如何讓一個進程運行一個函數?
simpliest PROGRAMM會是什麼樣子
#include <boost/process.hpp>
#include <string>
#include <vector>
namespace bp = ::boost::process;
void Hello()
{
//... contents does not matter for me now - I just want to make a new process running this function using Boost.Process.
}
bp::child start_child()
{
std::string exec = "bjam";
std::vector<std::string> args;
args.push_back("--version");
bp::context ctx;
ctx.stdout_behavior = bp::silence_stream();
return bp::launch(exec, args, ctx);
}
int main()
{
bp::child c = start_child();
bp::status s = c.wait();
return s.exited() ? s.exit_status() : EXIT_FAILURE;
}
我創造如何高大的進程執行你好()函數?
所以這意味着Boost.Process只是一個庫,可以啓動不止一次的命令行參數我的過程? – Rella 2011-01-23 17:09:38