All I want to do is to check whether an element exists in the vector or not, so I can deal with each case.
if ( item_present ) do_this(); else do_that(
If you wanna find a string in a vector:
struct isEqual { isEqual(const std::string& s): m_s(s) {} bool operator()(OIDV* l) { return l->oid == m_s; } std::string m_s; }; struct OIDV { string oid; //else }; VecOidv::iterator itFind=find_if(vecOidv.begin(),vecOidv.end(),isEqual(szTmp));