19 Aug 15:56
compatibility between g++ and msvc8
From: Guo Xu <goooxu <at> gmail.com>
Subject: compatibility between g++ and msvc8
Newsgroups: gmane.comp.lib.boost.user
Date: 2008-08-19 13:56:46 GMT
Subject: compatibility between g++ and msvc8
Newsgroups: gmane.comp.lib.boost.user
Date: 2008-08-19 13:56:46 GMT
#include <iostream>
#include <vector>
#include <boost/functional.hpp>
#include <boost/algorithm/string.hpp>
using namespace std;
using namespace boost;
int main()
{
vector<string> strs;
strs.push_back( "Beijing" );
strs.push_back( "Olympic" );
strs.push_back( "Game" );
vector<string>::iterator it = std::find_if( strs.begin(), strs.end(),
boost::bind2nd( boost::contains<string, string> , "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&)'
#include <vector>
#include <boost/functional.hpp>
#include <boost/algorithm/string.hpp>
using namespace std;
using namespace boost;
int main()
{
vector<string> strs;
strs.push_back( "Beijing" );
strs.push_back( "Olympic" );
strs.push_back( "Game" );
vector<string>::iterator it = std::find_if( strs.begin(), strs.end(),
boost::bind2nd( boost::contains<string, string> , "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&)'
_______________________________________________ Boost-users mailing list Boost-users <at> lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
RSS Feed