feat(util/rb_map): add find_if
This commit is contained in:
parent
f38af35e06
commit
9b15c4c669
1 changed files with 6 additions and 0 deletions
|
@ -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 << "{";
|
||||
|
|
Loading…
Add table
Reference in a new issue