| 54 | //! @return unique window in the list satisfying the predicate, or null |
| 55 | template< typename Pred > |
| 56 | wxWindow *UniqueWindowAmongPeers( |
| 57 | const wxWindowList &list, const Pred &pred ) |
| 58 | { |
| 59 | const auto begin = list.begin(), end = list.end(); |
| 60 | auto iter1 = std::find_if(begin, end, pred); |
| 61 | if (iter1 == end) |
| 62 | return nullptr; |
| 63 | auto next = iter1, iter2 = std::find_if(++next, end, pred); |
| 64 | if (iter2 != end) |
| 65 | return nullptr; |
| 66 | return *iter1; |
| 67 | } |
| 68 | |
| 69 | //! @return whether the window is uniquely named within the given list |
| 70 | bool HasUniqueNameAmongPeers( const wxWindow &window, const wxWindowList &list ) |
no test coverage detected