How can I use find_if with vector of data structures?
I have something like this:
struct Record{
int ID;
int Data1;
int Data2;
};
vector<Record> MyRecords;
I would like to find a record based on ID. Should I use find_if and how can I do it? I know how to use find_if with simple data types but do not know how to write function that checks the condition in this case.
Thank you a lot for your answer.
I have something like this:
struct Record{
int ID;
int Data1;
int Data2;
};
vector<Record> MyRecords;
I would like to find a record based on ID. Should I use find_if and how can I do it? I know how to use find_if with simple data types but do not know how to write function that checks the condition in this case.
Thank you a lot for your answer.
Comment