I have a list of elements, say, integers, and I want to see if my variable (another integer) is one of the list's elements.
In Python, I'd write:
my_list = [1,2,3,4] # elements
my_var = 3 # my variable
my_var in my_list # returns boolean
How does one go about doing this in C++? I considered using std::list, but there is no find method in it. Such a method can be found in the std::set structure.
More specifically, my program is given some unique ids (a list, a set, whatever) and I iterate over a long list of input data (ids) to see if they are included in the list (boolean value returned for each iteration step). And I'm not sure how to do it in C++.