#include <algorithm> #include <vector> if ( std::find(vec.begin(), vec.end(), item) != vec.end() ) do_this(); else do_that();