| 2631 | /// A search function |
| 2632 | template <typename T, typename V, enable_if_t<!has_find<T, V>::value, detail::enabler> = detail::dummy> |
| 2633 | auto search(const T &set, const V &val) -> std::pair<bool, decltype(std::begin(detail::smart_deref(set)))> { |
| 2634 | using element_t = typename detail::element_type<T>::type; |
| 2635 | auto &setref = detail::smart_deref(set); |
| 2636 | auto it = std::find_if(std::begin(setref), std::end(setref), [&val](decltype(*std::begin(setref)) v) { |
| 2637 | return (detail::pair_adaptor<element_t>::first(v) == val); |
| 2638 | }); |
| 2639 | return {(it != std::end(setref)), it}; |
| 2640 | } |
| 2641 | |
| 2642 | /// A search function that uses the built in find function |
| 2643 | template <typename T, typename V, enable_if_t<has_find<T, V>::value, detail::enabler> = detail::dummy> |
no test coverage detected