[英]Is _1 part of C++0x?
I've seen two recent answers using _1
as a pure C++0x solution (no explicit mention of boost lambdas). 我已经看到两个最近使用
_1
作为纯C ++ 0x解决方案的答案 (没有明确提到boost lambdas)。
Is there such an animal as std::_1
I would think that having native lambdas will make such a construct redundant. 是否有像
std::_1
这样的动物我会认为拥有原生的lambdas会使这样的构造变得多余。
A Google code search for std::_1
brings two results from the same project so that's inconclusive. 对
std::_1
Google代码搜索会从同一项目中获得两个结果 ,因此不确定。
Yes, they are part of C++0x inside the std::placeholders
namespace, from the latest draft (n3126) §20.8.10.1.3 "Placeholders": 是的,它们是
std::placeholders
命名空间中C ++ 0x的一部分,来自最新草案(n3126)§20.8.10.1.3“占位符”:
namespace std {
namespace placeholders {
// M is the implementation-defined number of placeholders
extern unspecified _1;
extern unspecified _2;
.
.
.
extern unspecified _M;
}
}
They are actually included in TR1 ( n1836 §3.6.4; n1455 ) along with bind
, which are taken from the Boost.Bind library . 它们实际上包含在TR1 ( n1836§3.6.4 ; n1455 )以及
bind
,它们来自Boost.Bind库 。
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的一部分,应该在符合编译器的
<functional>
头中定义,请参阅以下FAQ:
Yes, they are part of C++0x. 是的,它们是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.
我没有仔细检查TR1规格,但我怀疑它们是在那里添加的(TR1本质上是C ++ 03的仅库扩展,因此它不能依赖lambdas),然后,因为它已经存在在TR1中,在C ++ 0x中再次删除它是不必要的破坏性,即使你拥有真正的lambda已经不再需要它了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.