[STL]std::for_each

// for_each.  Apply a function to every element of a range.
template <class _InputIter, class _Function>
_Function for_each(_InputIter __first, _InputIter __last, _Function __f) {
  __STL_REQUIRES(_InputIter, _InputIterator);
  for ( ; __first != __last; ++__first)
    __f(*__first);
  return __f;
}

 

__f(T); 定义function类型的时候,是 operator()(class T)?

那么 boost::bind 返回的类型也必须是 []()(class T)? 

posted @ 2012-09-04 10:39  LambdaTea  阅读(702)  评论(0编辑  收藏  举报