Amleto has answers my question.
I made a mistake, the bind1st and bind2nd only accepts binary functor where my member function is a unary functor and the find_if.
I switch to boost now.
Why the second one has compile error since i follow the bind documentation ?Code:folderIconVecIte myIte = find_if(iconPool.begin(), iconPool.end(), boost::bind( boost::mem_fn(&folderIcon::IsExistFolderIconType), _1, folderIconType) ); Compile OK folderIconVecIte myIte = find_if(iconPool.begin(), iconPool.end(), boost::bind( boost::mem_fn(&folderIcon::IsExistFolderIconType), _1)(folderIconType) ); Compile Error - 2
Solve.




Reply With Quote