mirror of
https://github.com/abseil/abseil-cpp.git
synced 2026-06-04 20:14:23 +08:00
Add const qualifier to c_binary_search Sequence.
PiperOrigin-RevId: 506151912 Change-Id: I388884b0bd80ef0f8a0b3d3c7d0e1b404ddfb742
This commit is contained in:
committed by
Copybara-Service
parent
dcddc54407
commit
1a38beaaaf
@@ -1131,7 +1131,7 @@ c_equal_range(Sequence& sequence, const T& value, LessThan&& comp) {
|
||||
// to test if any element in the sorted container contains a value equivalent to
|
||||
// 'value'.
|
||||
template <typename Sequence, typename T>
|
||||
bool c_binary_search(Sequence&& sequence, const T& value) {
|
||||
bool c_binary_search(const Sequence& sequence, const T& value) {
|
||||
return std::binary_search(container_algorithm_internal::c_begin(sequence),
|
||||
container_algorithm_internal::c_end(sequence),
|
||||
value);
|
||||
@@ -1140,7 +1140,8 @@ bool c_binary_search(Sequence&& sequence, const T& value) {
|
||||
// Overload of c_binary_search() for performing a `comp` comparison other than
|
||||
// the default `operator<`.
|
||||
template <typename Sequence, typename T, typename LessThan>
|
||||
bool c_binary_search(Sequence&& sequence, const T& value, LessThan&& comp) {
|
||||
bool c_binary_search(const Sequence& sequence, const T& value,
|
||||
LessThan&& comp) {
|
||||
return std::binary_search(container_algorithm_internal::c_begin(sequence),
|
||||
container_algorithm_internal::c_end(sequence),
|
||||
value, std::forward<LessThan>(comp));
|
||||
|
||||
Reference in New Issue
Block a user