作者linbaskenny (傲天祥云)
看板Programming
标题[问题] C++ Primer 3/e中文版
时间Fri Mar 9 18:21:17 2007
P.591
int ires;
string sval1;
vector<string> svec;
//...
ires = count_if(svec.begin(), svec.end(), equal_to<string>(), sval1);
但SGI的版本是
template <class InputIterator, class Predicate>
iterator_traits<InputIterator>::difference_type
count_if(InputIterator first, InputIterator last, Predicate pred);
template <class InputIterator, class Predicate, class Size>
void count_if(InputIterator first, InputIterator last,
Predicate pred,
Size& n);
第四个参数型别也不一样
而具我所查到的资料
ires = count_if(svec.begin(), svec.end(), bind2nd(equal_to<string>(), sval1));
请高手解答疑惑@@
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.59.83.198
※ linbaskenny:转录至看板 C_and_CPP 03/09 22:34