我正在尝试创建一个boost::process
来自字符串参数向量:
void runProcess( const std::string& exe, const std::vector<std::string>& args )
{
bp::ipstream out;
bp::child c(exe, args, std_out > out);
...
}
这显然有效,但我收到以下警告:
警告 C4503:'boost::fusion::detail::for_each_linear':超出修饰名称长度,名称被截断
如果一一传递参数它就会消失bp::child c(exe, "param1", "param2", std_out > out);
.
正确的打电话方式是什么child
在这种情况下构造函数?
您将按预期使用:
bp::child c(bp::search_path("ls"), bp::args({"-1", "-l"})/*, ...*/);
在你的情况下也许像
void runProcess( const std::string& exe, const std::vector<std::string>& args )
{
bp::ipstream out;
bp::child c(exe, bp::args(args), std_out > out);
...
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)