I\'ve got a list of elements, say, integers and I want to check if my variable (another integer) is one of the elements from the list. In python I\'d do:
my_list
You can use std::find
std::find
bool found = (std::find(my_list.begin(), my_list.end(), my_var) != my_list.end());
You need to include . It should work on standard containers, vectors lists, etc...