10
10
#ifndef _LIBCPP___FLAT_MAP_FLAT_MULTISET_H
11
11
#define _LIBCPP___FLAT_MAP_FLAT_MULTISET_H
12
12
13
- #include " utils.h "
13
+ #include < __algorithm/equal_range.h >
14
14
#include < __algorithm/lexicographical_compare_three_way.h>
15
+ #include < __algorithm/lower_bound.h>
15
16
#include < __algorithm/min.h>
16
17
#include < __algorithm/ranges_equal.h>
17
- #include < __algorithm/ranges_equal_range.h>
18
18
#include < __algorithm/ranges_inplace_merge.h>
19
19
#include < __algorithm/ranges_is_sorted.h>
20
- #include < __algorithm/ranges_lower_bound.h>
21
- #include < __algorithm/ranges_partition_point.h>
22
20
#include < __algorithm/ranges_sort.h>
23
21
#include < __algorithm/ranges_unique.h>
24
- #include < __algorithm/ranges_upper_bound.h>
25
22
#include < __algorithm/remove_if.h>
23
+ #include < __algorithm/upper_bound.h>
26
24
#include < __assert>
27
25
#include < __compare/synth_three_way.h>
28
26
#include < __concepts/convertible_to.h>
@@ -523,43 +521,47 @@ class flat_multiset {
523
521
}
524
522
525
523
_LIBCPP_HIDE_FROM_ABI iterator lower_bound (const key_type& __x) {
526
- return iterator (ranges::lower_bound (std::as_const (__keys_), __x, __compare_));
524
+ const auto & __keys = __keys_;
525
+ return iterator (std::lower_bound (__keys.begin (), __keys.end (), __x, __compare_));
527
526
}
528
527
529
528
_LIBCPP_HIDE_FROM_ABI const_iterator lower_bound (const key_type& __x) const {
530
- return const_iterator (ranges ::lower_bound (__keys_, __x, __compare_));
529
+ return const_iterator (std ::lower_bound (__keys_. begin (), __keys_. end () , __x, __compare_));
531
530
}
532
531
533
532
template <class _Kp >
534
533
requires __is_transparent_v<_Compare>
535
534
_LIBCPP_HIDE_FROM_ABI iterator lower_bound (const _Kp& __x) {
536
- return iterator (ranges::lower_bound (std::as_const (__keys_), __x, __compare_));
535
+ const auto & __keys = __keys_;
536
+ return iterator (std::lower_bound (__keys.begin (), __keys.end (), __x, __compare_));
537
537
}
538
538
539
539
template <class _Kp >
540
540
requires __is_transparent_v<_Compare>
541
541
_LIBCPP_HIDE_FROM_ABI const_iterator lower_bound (const _Kp& __x) const {
542
- return const_iterator (ranges ::lower_bound (__keys_, __x, __compare_));
542
+ return const_iterator (std ::lower_bound (__keys_. begin (), __keys_. end () , __x, __compare_));
543
543
}
544
544
545
545
_LIBCPP_HIDE_FROM_ABI iterator upper_bound (const key_type& __x) {
546
- return iterator (ranges::upper_bound (std::as_const (__keys_), __x, __compare_));
546
+ const auto & __keys = __keys_;
547
+ return iterator (std::upper_bound (__keys.begin (), __keys.end (), __x, __compare_));
547
548
}
548
549
549
550
_LIBCPP_HIDE_FROM_ABI const_iterator upper_bound (const key_type& __x) const {
550
- return const_iterator (ranges ::upper_bound (__keys_, __x, __compare_));
551
+ return const_iterator (std ::upper_bound (__keys_. begin (), __keys_. end () , __x, __compare_));
551
552
}
552
553
553
554
template <class _Kp >
554
555
requires __is_transparent_v<_Compare>
555
556
_LIBCPP_HIDE_FROM_ABI iterator upper_bound (const _Kp& __x) {
556
- return iterator (ranges::upper_bound (std::as_const (__keys_), __x, __compare_));
557
+ const auto & __keys = __keys_;
558
+ return iterator (std::upper_bound (__keys.begin (), __keys.end (), __x, __compare_));
557
559
}
558
560
559
561
template <class _Kp >
560
562
requires __is_transparent_v<_Compare>
561
563
_LIBCPP_HIDE_FROM_ABI const_iterator upper_bound (const _Kp& __x) const {
562
- return const_iterator (ranges ::upper_bound (__keys_, __x, __compare_));
564
+ return const_iterator (std ::upper_bound (__keys_. begin (), __keys_. end () , __x, __compare_));
563
565
}
564
566
565
567
_LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range (const key_type& __x) {
@@ -630,7 +632,7 @@ class flat_multiset {
630
632
// |
631
633
// hint
632
634
// We want to insert "2" after the last existing "2"
633
- __hint = ranges ::upper_bound (begin (), __hint, __key, __compare_);
635
+ __hint = std ::upper_bound (begin (), __hint, __key, __compare_);
634
636
} else {
635
637
_LIBCPP_ASSERT_INTERNAL (!__prev_larger && __next_smaller, " this means that the multiset is not sorted" );
636
638
@@ -641,7 +643,7 @@ class flat_multiset {
641
643
// |
642
644
// hint
643
645
// We want to insert "2" before the first existing "2"
644
- __hint = ranges ::lower_bound (__hint, end (), __key, __compare_);
646
+ __hint = std ::lower_bound (__hint, end (), __key, __compare_);
645
647
}
646
648
return __flat_set_utils::__emplace_exact_pos (*this , __hint, std::forward<_Kp>(__key));
647
649
}
@@ -658,8 +660,9 @@ class flat_multiset {
658
660
659
661
template <class _Self , class _Kp >
660
662
_LIBCPP_HIDE_FROM_ABI static auto __equal_range_impl (_Self&& __self, const _Kp& __key) {
661
- using __iter = _If<is_const_v<__libcpp_remove_reference_t <_Self>>, const_iterator, iterator>;
662
- auto [__key_first, __key_last] = ranges::equal_range (__self.__keys_ , __key, __self.__compare_ );
663
+ using __iter = _If<is_const_v<__libcpp_remove_reference_t <_Self>>, const_iterator, iterator>;
664
+ auto [__key_first, __key_last] =
665
+ std::equal_range (__self.__keys_ .begin (), __self.__keys_ .end (), __key, __self.__compare_ );
663
666
return std::make_pair (__iter (__key_first), __iter (__key_last));
664
667
}
665
668
0 commit comments