Mike Copeland
2010-03-04 01:10:08 UTC
I've declared the data structure below and have loaded it with data.
Now, I need to find the appropriate "stateCode" for selected
"stateName" values. I tried to develop an operator to use with a
"find" call, but I get a C2678 error (MS VS6.0) on the "find" statement.
What am I doing wrong? TIA
struct StateData
{
string stateName;
string stateCode;
bool operator==(const StateData &rhs) const
{
return stateName == rhs.stateName;
}
} stateWork;
typedef list<StateData> StateData;
StateData stateList;
list<StateData>::iterator stIter;
stIter = find(stateList.begin(), stateList.end(), "Colorado"); // C2678
error
Now, I need to find the appropriate "stateCode" for selected
"stateName" values. I tried to develop an operator to use with a
"find" call, but I get a C2678 error (MS VS6.0) on the "find" statement.
What am I doing wrong? TIA
struct StateData
{
string stateName;
string stateCode;
bool operator==(const StateData &rhs) const
{
return stateName == rhs.stateName;
}
} stateWork;
typedef list<StateData> StateData;
StateData stateList;
list<StateData>::iterator stIter;
stIter = find(stateList.begin(), stateList.end(), "Colorado"); // C2678
error