C++ (Qt)if (std::find(mUsedThresholds.begin(), mUsedThresholds.end(), tindex) != mUsedThresholds.end()) mUsedThresholds.push_back(tindex);
C++ (Qt)class Threshols{public: bool isContains( int val ) const { return std::find( mUsedThresholds.begin(), mUsedThresholds.end(), val ) != mUsedThresholds.end(); } void append( int val ) { if( !isContains( val ) ) mUsedThresholds.push_back( val ); } private: std::vector<int> mUsedThresholds;};
C++ (Qt)if( !isContains( mUsedThresholds, tindex) ) mUsedThresholds.push_back( tindex );
C++ (Qt)if (!mUsedThresholds.contains(tindex)) mUsedThresholds.push_back(tIndex);
C++ (Qt)template<class T, class Val>bool MyContains( const T & vec, Val val ){ return std::find(vec.begin(), vec.end(), val) != vec.end();}
C++ (Qt)template<class T, class Val>bool VecContains( const std::vector<T> & vec, Val val );
C++ (Qt)if (std_ext::contains(mUsedThresholds, tindex)) ..
const auto v = {4, 1, 3, 2};if (auto result = ranges::find_if_not(v, is_even); result != v.end()) { std::cout << "First odd element in v: " << *result << '\n';} else { std::cout << "No odd elements in v\n";}
ranges::find_if_not(v, is_even);
ranges::find_if_not(v.begin(), v.end(), is_even);
if (auto result = findAll(v, is_even); !ranges::empty(result)) {// do smth}