mirror of
https://github.com/abseil/abseil-cpp.git
synced 2026-06-04 12:07:05 +08:00
Use constexpr instead of ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20
These are equivalent since they fall back to the standard library. There's no need to reimpose whatever constraints the standard library already imposes. PiperOrigin-RevId: 926341943 Change-Id: I406d1203ca2d4fec68ae7a06eef0cf2dad6916dd
This commit is contained in:
committed by
Copybara-Service
parent
bc5c03f738
commit
d96371953c
@@ -85,8 +85,8 @@ constexpr ForwardIt rotate(ForwardIt first, ForwardIt n_first, ForwardIt last) {
|
||||
// n = (`last` - `first`) comparisons. A linear search over short containers
|
||||
// may be faster than a binary search, even when the container is sorted.
|
||||
template <typename InputIterator, typename EqualityComparable>
|
||||
ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 bool linear_search(
|
||||
InputIterator first, InputIterator last, const EqualityComparable& value) {
|
||||
constexpr bool linear_search(InputIterator first, InputIterator last,
|
||||
const EqualityComparable& value) {
|
||||
return std::find(first, last, value) != last;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user