function object
std::ranges::binary_search
- Header
<algorithm>- Draft
- [binary.search]
- Scope
std::ranges- cppreference
- std::ranges::binary_search
Synopsis
inline constexpr /* implementation-defined */ binary_search = {};Call signatures
binary_search is a function object; these are its call operators as libycxx declares them, written as the functions the draft declares.
- (1)
template< std::ranges::forward_range R, class Proj = std::identity, class T = std::projected_value_t<iterator_t<R>, Proj>, std::indirect_strict_weak_order<const T*, std::projected<iterator_t<R>, Proj>> Comp = std::ranges::less> [[nodiscard]] constexpr bool binary_search( R&& r, const T& value, Comp comp = {}, Proj proj = {}); - (2)
template< std::forward_iterator I, std::sentinel_for<I> S, class Proj = std::identity, class T = std::projected_value_t<I, Proj>, std::indirect_strict_weak_order<const T*, std::projected<I, Proj>> Comp = std::ranges::less> [[nodiscard]] constexpr bool binary_search( I first, S last, const T& value, Comp comp = {}, Proj proj = {});