fune/tools/clang-tidy/test/performance-inefficient-algorithm.cpp
Jan Keromnes 11dd9afb58 Bug 1486410 - Bug 1466427 - Enable new clang-tidy 7.0 checks. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D4210

--HG--
extra : moz-landing-system : lando
2018-09-04 11:55:19 +00:00

30 lines
695 B
C++

namespace std {
template <typename T> struct less {
bool operator()(const T &lhs, const T &rhs) { return lhs < rhs; }
};
template <typename T> struct greater {
bool operator()(const T &lhs, const T &rhs) { return lhs > rhs; }
};
struct iterator_type {};
template <typename K, typename Cmp = less<K>> struct set {
typedef iterator_type iterator;
iterator find(const K &k);
unsigned count(const K &k);
iterator begin();
iterator end();
iterator begin() const;
iterator end() const;
};
template <typename FwIt, typename K>
FwIt find(FwIt, FwIt end, const K &) { return end; }
}
template <typename T> void f(const T &t) {
std::set<int> s;
find(s.begin(), s.end(), 46);
}