Range-v3
Range algorithms, views, and actions for the Standard Library
ranges::v3::binary_search_fn Struct Reference

Public Member Functions

template<typename I , typename S , typename V2 , typename C = ordered_less, typename P = ident, requires = (Sentinel<S, I>() && BinarySearchable<I, V2, C, P>())>
bool operator() (I begin, S end, V2 const &val, C pred=C{}, P proj=P{}) const
 function template binary_search_fn::operator() More...
 
template<typename Rng , typename V2 , typename C = ordered_less, typename P = ident, typename I = iterator_t<Rng>, requires = (Range<Rng>() && BinarySearchable<I, V2, C, P>())>
bool operator() (Rng &&rng, V2 const &val, C pred=C{}, P proj=P{}) const
 

Member Function Documentation

◆ operator()() [1/2]

template<typename I , typename S , typename V2 , typename C = ordered_less, typename P = ident, requires = (Sentinel<S, I>() && BinarySearchable<I, V2, C, P>())>
bool ranges::v3::binary_search_fn::operator() ( begin,
end,
V2 const &  val,
pred = C{},
proj = P{} 
) const

function template binary_search_fn::operator()

range-based version of the binary_search std algorithm

Precondition
Rng is a model of the Range concept

References ranges::v3::lower_bound, ranges::v3::move, and ranges::v3::ref.

◆ operator()() [2/2]

template<typename Rng , typename V2 , typename C = ordered_less, typename P = ident, typename I = iterator_t<Rng>, requires = (Range<Rng>() && BinarySearchable<I, V2, C, P>())>
bool ranges::v3::binary_search_fn::operator() ( Rng &&  rng,
V2 const &  val,
pred = C{},
proj = P{} 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

References ranges::v3::begin, ranges::v3::end, and ranges::v3::move.