您的位置:首页 > 其它

[STL]std::for_each

2012-09-04 10:39 267 查看
// 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)?
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: