find in vector

for (int i = 0; i < vec.size(); i++) { if (vec[i] == value) { return i; } } return -1;