首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

binder2nd类模板的op(_x, value)是什么意思啊该如何解决

2012-06-15 
binder2nd类模板的op(__x, value)是什么意思啊template class _Operationclass binder2nd: public unary

binder2nd类模板的op(__x, value)是什么意思啊
template <class _Operation>
  class binder2nd: public unary_function<typename _Operation::first_argument_type, typename _Operation::result_type>
  {
  protected:
  _Operation op;
  typename _Operation::second_argument_type value;
  public:
  binder2nd(const _Operation& __x,const typename _Operation::second_argument_type& __y): op(__x), value(__y) {}
  typename _Operation::result_type operator()(const typename _Operation::first_argument_type& __x) const
  { return op(__x, value); }

  // _GLIBCXX_RESOLVE_LIB_DEFECTS
  // 109. Missing binders for non-const sequence elements
  typename _Operation::result_type operator()(typename _Operation::first_argument_type& __x) const
  { return op(__x, value); }
  };
  以上是binder2nd类模板定义,在不同编译器中类型名可能不同,但定义是一样的,其中的一句话op(_x,value)是什么意思啊。我理解op是_Operation类型变量或者对象,但已经定义的变量或者对象后跟括号,括号里也有变量或者对象,就不知道什么意思了。

[解决办法]
函数调用
operator()

热点排行