Skip to content

Commit c22c032

Browse files
Abseil Teamdinord
authored andcommitted
Export of internal Abseil changes
-- 4fd27d1c0fda72a8772f2779714c327b18ae657b by Derek Mauro <[email protected]>: Adds missing documentation for btree's lower_bound and upper_bound methods PiperOrigin-RevId: 395777262 GitOrigin-RevId: 4fd27d1c0fda72a8772f2779714c327b18ae657b Change-Id: Ife2f9149bcf30523be93ee9d8919c7085a9d3a29
1 parent 8c800bb commit c22c032

File tree

2 files changed

+118
-24
lines changed

2 files changed

+118
-24
lines changed

absl/container/btree_map.h

Lines changed: 60 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,8 @@ class btree_map
366366
// Determines whether an element comparing equal to the given `key` exists
367367
// within the `btree_map`, returning `true` if so or `false` otherwise.
368368
//
369-
// Supports heterogeneous lookup, provided that the map is provided a
370-
// compatible heterogeneous comparator.
369+
// Supports heterogeneous lookup, provided that the map has a compatible
370+
// heterogeneous comparator.
371371
using Base::contains;
372372

373373
// btree_map::count()
@@ -378,8 +378,8 @@ class btree_map
378378
// the `btree_map`. Note that this function will return either `1` or `0`
379379
// since duplicate elements are not allowed within a `btree_map`.
380380
//
381-
// Supports heterogeneous lookup, provided that the map is provided a
382-
// compatible heterogeneous comparator.
381+
// Supports heterogeneous lookup, provided that the map has a compatible
382+
// heterogeneous comparator.
383383
using Base::count;
384384

385385
// btree_map::equal_range()
@@ -395,10 +395,34 @@ class btree_map
395395
//
396396
// Finds an element with the passed `key` within the `btree_map`.
397397
//
398-
// Supports heterogeneous lookup, provided that the map is provided a
399-
// compatible heterogeneous comparator.
398+
// Supports heterogeneous lookup, provided that the map has a compatible
399+
// heterogeneous comparator.
400400
using Base::find;
401401

402+
// btree_map::lower_bound()
403+
//
404+
// template <typename K> iterator lower_bound(const K& key):
405+
// template <typename K> const_iterator lower_bound(const K& key) const:
406+
//
407+
// Finds the first element with a key that is not less than `key` within the
408+
// `btree_map`.
409+
//
410+
// Supports heterogeneous lookup, provided that the map has a compatible
411+
// heterogeneous comparator.
412+
using Base::lower_bound;
413+
414+
// btree_map::upper_bound()
415+
//
416+
// template <typename K> iterator upper_bound(const K& key):
417+
// template <typename K> const_iterator upper_bound(const K& key) const:
418+
//
419+
// Finds the first element with a key that is greater than `key` within the
420+
// `btree_map`.
421+
//
422+
// Supports heterogeneous lookup, provided that the map has a compatible
423+
// heterogeneous comparator.
424+
using Base::upper_bound;
425+
402426
// btree_map::operator[]()
403427
//
404428
// Returns a reference to the value mapped to the passed key within the
@@ -691,8 +715,8 @@ class btree_multimap
691715
// Determines whether an element comparing equal to the given `key` exists
692716
// within the `btree_multimap`, returning `true` if so or `false` otherwise.
693717
//
694-
// Supports heterogeneous lookup, provided that the map is provided a
695-
// compatible heterogeneous comparator.
718+
// Supports heterogeneous lookup, provided that the map has a compatible
719+
// heterogeneous comparator.
696720
using Base::contains;
697721

698722
// btree_multimap::count()
@@ -702,8 +726,8 @@ class btree_multimap
702726
// Returns the number of elements comparing equal to the given `key` within
703727
// the `btree_multimap`.
704728
//
705-
// Supports heterogeneous lookup, provided that the map is provided a
706-
// compatible heterogeneous comparator.
729+
// Supports heterogeneous lookup, provided that the map has a compatible
730+
// heterogeneous comparator.
707731
using Base::count;
708732

709733
// btree_multimap::equal_range()
@@ -720,10 +744,34 @@ class btree_multimap
720744
//
721745
// Finds an element with the passed `key` within the `btree_multimap`.
722746
//
723-
// Supports heterogeneous lookup, provided that the map is provided a
724-
// compatible heterogeneous comparator.
747+
// Supports heterogeneous lookup, provided that the map has a compatible
748+
// heterogeneous comparator.
725749
using Base::find;
726750

751+
// btree_multimap::lower_bound()
752+
//
753+
// template <typename K> iterator lower_bound(const K& key):
754+
// template <typename K> const_iterator lower_bound(const K& key) const:
755+
//
756+
// Finds the first element with a key that is not less than `key` within the
757+
// `btree_multimap`.
758+
//
759+
// Supports heterogeneous lookup, provided that the map has a compatible
760+
// heterogeneous comparator.
761+
using Base::lower_bound;
762+
763+
// btree_multimap::upper_bound()
764+
//
765+
// template <typename K> iterator upper_bound(const K& key):
766+
// template <typename K> const_iterator upper_bound(const K& key) const:
767+
//
768+
// Finds the first element with a key that is greater than `key` within the
769+
// `btree_multimap`.
770+
//
771+
// Supports heterogeneous lookup, provided that the map has a compatible
772+
// heterogeneous comparator.
773+
using Base::upper_bound;
774+
727775
// btree_multimap::get_allocator()
728776
//
729777
// Returns the allocator function associated with this `btree_multimap`.

absl/container/btree_set.h

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ class btree_set
300300
// Determines whether an element comparing equal to the given `key` exists
301301
// within the `btree_set`, returning `true` if so or `false` otherwise.
302302
//
303-
// Supports heterogeneous lookup, provided that the set is provided a
304-
// compatible heterogeneous comparator.
303+
// Supports heterogeneous lookup, provided that the set has a compatible
304+
// heterogeneous comparator.
305305
using Base::contains;
306306

307307
// btree_set::count()
@@ -312,8 +312,8 @@ class btree_set
312312
// the `btree_set`. Note that this function will return either `1` or `0`
313313
// since duplicate elements are not allowed within a `btree_set`.
314314
//
315-
// Supports heterogeneous lookup, provided that the set is provided a
316-
// compatible heterogeneous comparator.
315+
// Supports heterogeneous lookup, provided that the set has a compatible
316+
// heterogeneous comparator.
317317
using Base::count;
318318

319319
// btree_set::equal_range()
@@ -330,10 +330,32 @@ class btree_set
330330
//
331331
// Finds an element with the passed `key` within the `btree_set`.
332332
//
333-
// Supports heterogeneous lookup, provided that the set is provided a
334-
// compatible heterogeneous comparator.
333+
// Supports heterogeneous lookup, provided that the set has a compatible
334+
// heterogeneous comparator.
335335
using Base::find;
336336

337+
// btree_set::lower_bound()
338+
//
339+
// template <typename K> iterator lower_bound(const K& key):
340+
// template <typename K> const_iterator lower_bound(const K& key) const:
341+
//
342+
// Finds the first element that is not less than `key` within the `btree_set`.
343+
//
344+
// Supports heterogeneous lookup, provided that the set has a compatible
345+
// heterogeneous comparator.
346+
using Base::lower_bound;
347+
348+
// btree_set::upper_bound()
349+
//
350+
// template <typename K> iterator upper_bound(const K& key):
351+
// template <typename K> const_iterator upper_bound(const K& key) const:
352+
//
353+
// Finds the first element that is greater than `key` within the `btree_set`.
354+
//
355+
// Supports heterogeneous lookup, provided that the set has a compatible
356+
// heterogeneous comparator.
357+
using Base::upper_bound;
358+
337359
// btree_set::get_allocator()
338360
//
339361
// Returns the allocator function associated with this `btree_set`.
@@ -604,8 +626,8 @@ class btree_multiset
604626
// Determines whether an element comparing equal to the given `key` exists
605627
// within the `btree_multiset`, returning `true` if so or `false` otherwise.
606628
//
607-
// Supports heterogeneous lookup, provided that the set is provided a
608-
// compatible heterogeneous comparator.
629+
// Supports heterogeneous lookup, provided that the set has a compatible
630+
// heterogeneous comparator.
609631
using Base::contains;
610632

611633
// btree_multiset::count()
@@ -615,8 +637,8 @@ class btree_multiset
615637
// Returns the number of elements comparing equal to the given `key` within
616638
// the `btree_multiset`.
617639
//
618-
// Supports heterogeneous lookup, provided that the set is provided a
619-
// compatible heterogeneous comparator.
640+
// Supports heterogeneous lookup, provided that the set has a compatible
641+
// heterogeneous comparator.
620642
using Base::count;
621643

622644
// btree_multiset::equal_range()
@@ -633,10 +655,34 @@ class btree_multiset
633655
//
634656
// Finds an element with the passed `key` within the `btree_multiset`.
635657
//
636-
// Supports heterogeneous lookup, provided that the set is provided a
637-
// compatible heterogeneous comparator.
658+
// Supports heterogeneous lookup, provided that the set has a compatible
659+
// heterogeneous comparator.
638660
using Base::find;
639661

662+
// btree_multiset::lower_bound()
663+
//
664+
// template <typename K> iterator lower_bound(const K& key):
665+
// template <typename K> const_iterator lower_bound(const K& key) const:
666+
//
667+
// Finds the first element that is not less than `key` within the
668+
// `btree_multiset`.
669+
//
670+
// Supports heterogeneous lookup, provided that the set has a compatible
671+
// heterogeneous comparator.
672+
using Base::lower_bound;
673+
674+
// btree_multiset::upper_bound()
675+
//
676+
// template <typename K> iterator upper_bound(const K& key):
677+
// template <typename K> const_iterator upper_bound(const K& key) const:
678+
//
679+
// Finds the first element that is greater than `key` within the
680+
// `btree_multiset`.
681+
//
682+
// Supports heterogeneous lookup, provided that the set has a compatible
683+
// heterogeneous comparator.
684+
using Base::upper_bound;
685+
640686
// btree_multiset::get_allocator()
641687
//
642688
// Returns the allocator function associated with this `btree_multiset`.

0 commit comments

Comments
 (0)