3#ifndef TETL_ALGORITHM_BINARY_SEARCH_HPP
4#define TETL_ALGORITHM_BINARY_SEARCH_HPP
19template <
typename ForwardIt,
typename T,
typename Compare>
20[[nodiscard]]
constexpr auto binary_search(ForwardIt first, ForwardIt last, T
const& value, Compare comp) ->
bool
23 return first != last and not comp(value, *first);
26template <
typename ForwardIt,
typename T>
27[[nodiscard]]
constexpr auto binary_search(ForwardIt first, ForwardIt last, T
const& value) ->
bool
constexpr auto binary_search(ForwardIt first, ForwardIt last, T const &value, Compare comp) -> bool
Checks if an element equivalent to value appears within the range [first, last). For binary_search to...
Definition binary_search.hpp:20
constexpr auto lower_bound(ForwardIt first, ForwardIt last, T const &value, Compare comp) noexcept -> ForwardIt
Returns an iterator pointing to the first element in the range [first, last) that is not less than (i...
Definition lower_bound.hpp:21
Definition adjacent_find.hpp:8
Function object for performing comparisons. Unless specialised, invokes operator< on type T....
Definition less.hpp:14