#include <iostream>
#include <vector>
#include
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 19 August 2008 09:56 am, Guo Xu wrote:
vector<string>::iterator it = std::find_if( strs.begin(), strs.end(), boost::bind2nd( boost::contains
, "mp" ) ); return 0; }
why this part of programe can be compiled on the mscv8, but can not be compled on the g++?
the error prompt is: stringalgo.cpp: In function 'int main()': stringalgo.cpp:29: error: no matching function for call to 'bind2nd(<unresolved overloaded function type>, std::string&)'
Its having trouble deciding between the 2 and 3 template argument overloads of
boost::contains. You can resolve it by explicitly decaring a function
pointer:
bool (*contains_p)(const std::string &, const std::string &) =
&boost::contains
participants (2)
-
Frank Mori Hess
-
Guo Xu