Hi folks,
I'm trying to search a std::vector declared like this:
std::vector<MyItem*> myNodeContainer;
where MyItem is looking like this:
class MyItem :public QGraphicsItem
{
public:
MyItem(QString QwNodeType, QString iQwFamilyType);
int testID;
...
Now, I've built a function to search the testID:
struct findNodeUUID2 {
findNodeUUID2(int i) : id(i) { }
bool operator()(const MyItem* &obj) { return (obj->testID==id); }
int id;
};
and I try to search like this:
std::vector<MyItem*>::iterator findNodeIterator;
findNodeIterator=std::find_if(myNodeContainer.begin(),myNodeContainer.end(), findNodeUUID2(1234) );
Linker errors as follows:
stl_algo.h.... No matching function for call to object of type 'findNodeUUID2'
What am I doing wrong? I suppose I'm using pointers the wrong way? Thanks for any suggestion