Error: no operator "==" matches these operands

I'm trying to perform a binary search on a vector of strings, and I keep getting this error. The entire program is rather long, so I'll only post the part that matters:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
int binarySearch(PhoneEntry keyP, vector<PhoneEntry> entryNames)
{
	int low = 0, mid, high = entryNames.size()-1;

	while (low <= high)
	{
		mid = (low + high) / 2;
		if (keyP.greaterAlpha(entryNames[mid]))
//graterAlpha is a function that compares two strings and returns true or false based on which is first alphabetically
			high = mid - 1;
		else if (!keyP.greaterAlpha(entryNames[mid]))
			low = high + 1;
		else
			low = high + 1;
	}

	if (keyP == entryNames[mid])//this is where I keep getting the error
		return mid;
	else
		return (mid * -1);
};


I've included both the string and vector header files, so I don't know what is causing this. Any help will be greatly appreciated!
have you overloaded the "==" operator in class PhoneEntry?
I don't think so...here's the class declaration for PhoneEntry (if that helps at all)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
class PhoneEntry
{
private:
	PhoneNumber eNumber;
	string firstName, 
		   lastName;
	void writeDots(ostream&, int) const;
public:
	istream& readEntry(istream&);
	ostream& writeEntry(ostream&) const;
	bool greaterAlpha(const PhoneEntry &);
	void mySort(vector<PhoneEntry>&, int);
	PhoneEntry key(string, string);
};
Topic archived. No new replies allowed.