_1 是 C++0x 的一部分吗?
我看到了两个最近的答案 使用 _1
作为纯 C++0x 解决方案(没有明确提及 boost lambda)。
是否有像 std::_1
这样的动物我认为拥有本机 lambda 将使这样的构造变得多余。
对 std::_1
的 Google 代码搜索会带来 同一项目的两个结果,因此尚无定论。
I've seen two recent answers using _1
as a pure C++0x solution (no explicit mention of boost lambdas).
Is there such an animal as std::_1
I would think that having native lambdas will make such a construct redundant.
A Google code search for std::_1
brings two results from the same project so that's inconclusive.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,它们是
std::placeholders
命名空间内 C++0x 的一部分,来自最新草案 (n3126) §20.8.10.1.3“占位符”:它们实际上是 包含在 TR1 (n1836 §3.6.4; n1455) 以及
bind
,均取自 Boost.Bind 库。Yes, they are part of C++0x inside the
std::placeholders
namespace, from the latest draft (n3126) §20.8.10.1.3 "Placeholders":They are actually included in TR1 (n1836 §3.6.4; n1455) along with
bind
, which are taken from the Boost.Bind library.是的,它们是 C++0x 的一部分。我还没有仔细检查 TR1 规范,但我怀疑它们被添加到那里(TR1 本质上是 C++03 的仅库扩展,因此它不能依赖 lambda),然后,因为它已经存在了在 TR1 中,在 C++0x 中再次删除它会造成不必要的破坏,尽管一旦有了真正的 lambda 就不再需要它了。
Yes, they are part of C++0x. I haven't double-checked the TR1 specs, but I suspect they were added there (TR1 was essentially a library-only extension to C++03, so it couldn't rely on lambdas), and then, since it's already there in TR1, it'd be needlessly disruptive to remove it again in C++0x, even though it's no longer really necessary once you have true lambdas.
显然它们是 C++ 0x 的一部分,应该在一致编译器的
标头中定义,请参阅以下常见问题解答:C++ 0x 常见问题解答
Apparently they are part of C++ 0x and should be defined in the
<functional>
header in a conformant compiler, see the following FAQ:C++ 0x FAQ