22 #ifndef EDSP_BINARY_SEARCH_HPP 23 #define EDSP_BINARY_SEARCH_HPP 26 #include <edsp/meta/iterator.hpp> 28 namespace edsp {
inline namespace algorithm {
40 template <
typename ForwardIt>
41 constexpr ForwardIt
binary_search(ForwardIt first, ForwardIt last,
const meta::value_type_t<ForwardIt>& value) {
42 const auto it = std::lower_bound(first, last, value);
43 return (it != last && (value == *it)) ? it : last;
49 #endif // EDSP_BINARY_SEARCH_HPP constexpr ForwardIt binary_search(ForwardIt first, ForwardIt last, const meta::value_type_t< ForwardIt > &value)
Checks if an element equivalent to value appears within the range [first, last).
Definition: binary_search.hpp:41
Definition: amplifier.hpp:29