feat(util/rb_map): add find_if

This commit is contained in:
Leonardo de Moura 2016-02-24 15:30:25 -08:00
parent f38af35e06
commit 9b15c4c669

View file

@ -73,6 +73,12 @@ public:
return m_map.for_each(f_prime);
}
template<typename F>
optional<T> find_if(F && f) const {
auto f_prime = [&](entry const & e) { return f(e.first, e.second); };
return m_map.find_if(f_prime);
}
/** \brief (For debugging) Display the content of this splay map. */
friend std::ostream & operator<<(std::ostream & out, rb_map const & m) {
out << "{";