SyntaxFix
Write A Post
Hire A Developer
Questions
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 <algorithm>. It should work on standard containers, vectors lists, etc...
<algorithm>