升压中的进程

发布于 2024-10-04 02:57:07 字数 602 浏览 0 评论 0原文

我正在使用 boost.process (用于提升的附加库)。在我提供的链接页面上,您可以找到使用示例。我安装了库,添加: #include 和一些以下代码:

namespace bp = ::boost::processes; // In samples the namespace name is process!
bp::command_line temp("ls");

error: ‘command_line’ is not a member of ‘bp’

对于所有描述的示例,我都有这样的错误。怎么了?


我知道真正的命名空间应该是 process,但我查看了代码,发现它是用 boostprocesses 命名空间包装的。所以没有任何process命名空间。

I'm using boost.process (additional lib for boost). At the page I gave for the link you can find samples of usage. I installed library, add: #include <boost/process.hpp> and some following code:

namespace bp = ::boost::processes; // In samples the namespace name is process!
bp::command_line temp("ls");

error: ‘command_line’ is not a member of ‘bp’

And I have such errors for all described samples. What's wrong?


I know that real namespace should be process, but I looked into the code and found that it's wrapped with boost and then processes namespaces. So there aren't any process namespace.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏末的微笑 2024-10-11 02:57:07

您是否可能使用不同/旧/替代版本的升压过程,即您是否从 沙盒 最近?
如果您打开 boost/process.hpp,您是否会在顶部看到以下内容?

// 版权所有 (c) 2006, 2007 Julio M. Merino Vidal
// 版权所有 (c) 2008, 2009 Boris Schaeling

我记得过去有另一位作者提供的另一个版本的 boost 过程。

我查看了 Vidal/Schaeling 的一些进程文件,它们肯定都使用 boost::process 命名空间。如果您在源代码中没有看到这一点,则您可能正在使用其他版本。另外,我在 http://www.highscore.de 上提供的参考中没有看到任何命令行条目/boost/process/。仅供参考,boost 过程最近也经历了许多变化(在 boost 邮件列表上的讨论之后)。

Are you not maybe using a different/older/alternate version of boost process i.e. did you get boost process from the sandbox recently?
If you open up boost/process.hpp do you see the following at the top?

// Copyright (c) 2006, 2007 Julio M. Merino Vidal
// Copyright (c) 2008, 2009 Boris Schaeling

I recall that there was another version of boost process by another author available in the past.

I had a look at some of the process files by Vidal/Schaeling and they definitely all use the boost::process namespace. If you do not see that in the source, you are prob using another version. Also, I did not see any entries for command_line in the reference available at http://www.highscore.de/boost/process/. FYI, boost process also went through numerous changes recently (following discussions on the boost mailing list).

琉璃梦幻 2024-10-11 02:57:07

好吧,正如您自己所说,示例中的命名空间是 ::boost::process。行:

namespace bp = ::boost::processes

仅定义了一个命名空间别名:bp::boost::processes的别名。编写 bp::command_line 与编写 boost::processes::command_line 完全相同。由于 command_line 驻留在 boost::process 命名空间中,因此找不到该类型。

Well, as you say it yourself, the namespace from the samples is ::boost::process. The line :

namespace bp = ::boost::processes

only defines a namespace alias : bp:: is an alias for boost::processes. Writing bp::command_line is exactly like writing boost::processes::command_line. As command_line resides in the boost::process namespace, the type is not found.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文