[#absl-c_binary_search-0e] = xref:absl.adoc[absl]::c_binary_search :relfileprefix: ../ :mrdocs: `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'. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Sequence, typename T> constexpr bool xref:absl/c_binary_search-05.adoc[c_binary_search]( Sequence const& sequence, T const& value); ---- [.small]#xref:absl/c_binary_search-05.adoc[_» more..._]# Overload of `c_binary_search()` for performing a `comp` comparison other than the default `operator<`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Sequence, typename T, typename LessThan> constexpr bool xref:absl/c_binary_search-0c.adoc[c_binary_search]( Sequence const& sequence, T const& value, LessThan&& comp); ---- [.small]#xref:absl/c_binary_search-0c.adoc[_» more..._]# == Return Value * `true` if an element equivalent to `value` exists, otherwise `false`. * `true` if an element equivalent to `value` under `comp` exists, otherwise `false`. == Parameters [cols="1,4"] |=== | Name| Description | *sequence* | The sorted container to search. | *value* | The value to search for. | *comp* | The comparison used to order the elements. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#