c_binary_search overloads
Synopses
Declared in <absl/algorithm/container.h>
Container‐based version of the <algorithm> std::binary_search() function to test if any element in the sorted container contains a value equivalent to 'value'.
template<
typename Sequence,
typename T>
constexpr
bool
c_binary_search(
Sequence const& sequence,
T const& value);
Overload of c_binary_search() for performing a comp comparison other than the default operator<.
template<
typename Sequence,
typename T,
typename LessThan>
constexpr
bool
c_binary_search(
Sequence const& sequence,
T const& value,
LessThan&& comp);
Return Value
-
trueif an element equivalent tovalueexists, otherwisefalse. -
trueif an element equivalent tovalueundercompexists, otherwisefalse.
Parameters
Name |
Description |
sequence |
The sorted container to search. |
value |
The value to search for. |
comp |
The comparison used to order the elements. |
Created with MrDocs