Here you have an iterator on your left. This is a container which, when dereference becomes an object, but it also has links to the other objects in the list.
On the right of your operator is a function which returns an
. An int can't be used like an iterator. It's incompatible.
You'll either need to:
1) Change SearchBrand() to return an iterator.
2) Find a suitable method to convert from the int to an iterator.
Assuming BrandName is a list<Brand>, your search function may look something like this:
list<Brand>::iterator SearchBrand(list<Brand>& bn)
for (list<Brand>::iterator it = br.begin(); it != br.end(); ++it)
if (bn->name = "Pick Me!")
If the integer is supposed to represent the index of the object in the list try this:
int i = SearchBrand(BrandName);
Note that to use that code snippet, you'll need to use std::vector instead of std::list.