[問題] C++ Primer 3/e中文版
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
討論串 (同標題文章)
完整討論串 (本文為第 1 之 2 篇):
Programming 近期熱門文章
PTT數位生活區 即時熱門文章