I am looking for a way to randomly pick a vector item in which a special property has the specified value.
as an example:
I have a vector from struct Student
struct Student{
string name;
float x;
float y;
bool dropped;
};
std::vector<Student> students;
in this case, select a random item in which the dropped value is true.
what is the most efficient way to do so?