Export of internal Abseil changes
-- 3a871e2cd854a46770a9416189953b2b38980bcf by Andy Getzendanner <durandal@google.com>: Import of CCTZ from GitHub. PiperOrigin-RevId: 280660534 -- f5a155fb056dcf68b089c21aebb5bf5159dc0eb3 by Tom Manshreck <shreck@google.com>: Nit: fix format of algorithm.h comments PiperOrigin-RevId: 280474139 -- 08b117a18353c0daf51b33b45100e5a007e5ab0c by Abseil Team <absl-team@google.com>: Allow absl::Notification::HasBeenNotified to be inlined. PiperOrigin-RevId: 280453271 -- 26d33dd2bad72945f1987f7b2669dbec3a6247e6 by Derek Mauro <dmauro@google.com>: Fix unused variable warnings on Windows PiperOrigin-RevId: 280324417 -- 907e9b23029be683af3b443bafd6a577a595922f by Abseil Team <absl-team@google.com>: PeriodicSampler implementation (for internal-use only) PiperOrigin-RevId: 280257168 GitOrigin-RevId: 3a871e2cd854a46770a9416189953b2b38980bcf Change-Id: I6e2978cae22a6adc41c0577e5c21355e9db7c8f5
This commit is contained in:
parent
fa8c75182f
commit
3df7b52a6a
12 changed files with 581 additions and 19 deletions
|
@ -84,6 +84,8 @@ It RotateImpl(It first, It middle, It last, std::false_type) {
|
|||
|
||||
} // namespace algorithm_internal
|
||||
|
||||
// equal()
|
||||
//
|
||||
// Compares the equality of two ranges specified by pairs of iterators, using
|
||||
// the given predicate, returning true iff for each corresponding iterator i1
|
||||
// and i2 in the first and second range respectively, pred(*i1, *i2) == true
|
||||
|
@ -104,8 +106,8 @@ bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2,
|
|||
typename std::iterator_traits<InputIter2>::iterator_category{});
|
||||
}
|
||||
|
||||
// Performs comparison of two ranges specified by pairs of iterators using
|
||||
// operator==.
|
||||
// Overload of equal() that performs comparison of two ranges specified by pairs
|
||||
// of iterators using operator==.
|
||||
template <typename InputIter1, typename InputIter2>
|
||||
bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2,
|
||||
InputIter2 last2) {
|
||||
|
@ -113,6 +115,8 @@ bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2,
|
|||
algorithm_internal::EqualTo{});
|
||||
}
|
||||
|
||||
// linear_search()
|
||||
//
|
||||
// Performs a linear search for `value` using the iterator `first` up to
|
||||
// but not including `last`, returning true if [`first`, `last`) contains an
|
||||
// element equal to `value`.
|
||||
|
@ -126,6 +130,8 @@ bool linear_search(InputIterator first, InputIterator last,
|
|||
return std::find(first, last, value) != last;
|
||||
}
|
||||
|
||||
// rotate()
|
||||
//
|
||||
// Performs a left rotation on a range of elements (`first`, `last`) such that
|
||||
// `middle` is now the first element. `rotate()` returns an iterator pointing to
|
||||
// the first element before rotation. This function is exactly the same as
|
||||
|
@ -135,7 +141,6 @@ bool linear_search(InputIterator first, InputIterator last,
|
|||
// The complexity of this algorithm is the same as that of `std::rotate`, but if
|
||||
// `ForwardIterator` is not a random-access iterator, then `absl::rotate`
|
||||
// performs an additional pass over the range to construct the return value.
|
||||
|
||||
template <typename ForwardIterator>
|
||||
ForwardIterator rotate(ForwardIterator first, ForwardIterator middle,
|
||||
ForwardIterator last) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue