I have 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 would do:
my_list = [1,2,3,4]
How to do it in C ++? I was thinking about using std::list , but there is no find method in it. I see such a method in the std::set structure.
More deeply, the problem is that my program is given some unique identifiers (list, set, etc.), and I iterate over a long list of input data (ids) and check if they are included in the list (boolean value returned for each iteration step). And I'm not sure how to do this in C ++.
c ++ contains
ducin Jun 10 '14 at 11:05 2014-06-10 11:05
source share