I want to find a struct whose all member data match certain values.
I made a following short program:
#include <iostream>
#include <vector>
using namespace std;
struct vlan {
int vlanId;
bool status;
};
vector<vlan> vlanTable;
int main(){
vlan tmp;
tmp.status = true;
tmp.vlanId = 1;
vector <vlan>::iterator flag = find(vlanTable.begin(), vlanTable.end(), tmp);
if ( flag != vlanTable.end()){
cout<<"found"<<endl;
}
else cout<<"not found"<<endl;
return 0;
}
It returns error as: template argument deduction/substitution failed right at the find function.
Could someone help me?