本文介绍了是的C ++ 0x的一部分_1?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过最近使用 _1 作为一个纯粹的C ++ 0x的解决方案(升压lambda表达式没有明确提及)。

I've seen two recent answers using _1 as a pure C++0x solution (no explicit mention of boost lambdas).

有没有这样的动物如的std :: _ 1 我认为有本地lambda表达式将会使这种结构是多余的。

Is there such an animal as std::_1 I would think that having native lambdas will make such a construct redundant.

一个谷歌code搜索的std :: _ 1 带来的的所以这是不确定的。

A Google code search for std::_1 brings two results from the same project so that's inconclusive.

推荐答案

是的,他们是C ++ 0x中的的std ::占位符命名空间内,从零件最新的草案(n3126)§20.8.10.1.3占位符:

Yes, they are part of C++0x inside the std::placeholders namespace, from the latest draft (n3126) §20.8.10.1.3 "Placeholders":

namespace std {
   namespace placeholders {
      // M is the implementation-defined number of placeholders
      extern unspecified _1;
      extern unspecified _2;
        .
        .
        .
      extern unspecified _M;
   }
}

他们实际上是 href=\"http://en.wikipedia.org/wiki/C%2B%2B_Technical_Report_1#Function_object_binders\">(的§3.6.4;的)与绑定,这是从的。

They are actually included in TR1 (n1836 §3.6.4; n1455) along with bind, which are taken from the Boost.Bind library.

这篇关于是的C ++ 0x的一部分_1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 01:21