Re: C2440 & C2439 Errors
Furthermore, just because you can't understand the errors doesn't mean we
haven't seen them before. You did a great job posting the right amount of
code, in the future post the error messages as well.
"Mike Copeland" <mrc2323@cox.net> wrote in message
news:MPG.253d5cbd140f6250989786@news.cox.net...
The following code fails to compile (VC6.0; errors C2440 & C2439),
and the offending code is the "find_if" line in main. (As with most MS
error diagnostics,) I can't make any sense out of the messages and don't
know what to do to correct the errors. Please advise. TIA
#pragma warning (disable:4786)
#include <map>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
typedef struct ChipRec
{
int bibNum;
string entName;
} tData;
typedef multimap<string, ChipRec> CHIPINFO;
CHIPINFO mmci;
multimap<string, ChipRec>::iterator cIter;
tData tWork;
tData qWork;
typedef map<int, ChipRec> BCI;
BCI bci;
map<int, ChipRec>::iterator bIter;
class NameMatch
{
string m_name;
public:
NameMatch(string const &name) : m_name(name) {}
bool operator()(const map<int, ChipRec>::value_type const &v)
const
{
string nameWork;
nameWork = v.second.entName;
return nameWork == m_name;
}
};
int main()
{
string tStr = "The Phantom Spitter";
CHIPINFO::iterator it = find_if(mmci.begin(), mmci.end(),
NameMatch(tStr));
return 0;
}