@@ -510,31 +510,31 @@ class flat_map {
510
510
}
511
511
512
512
// iterators
513
- _LIBCPP_HIDE_FROM_ABI iterator begin () noexcept {
513
+ _LIBCPP_HIDE_FROM_ABI iterator begin () noexcept _LIBCPP_LIFETIMEBOUND {
514
514
return iterator (__containers_.keys .begin (), __containers_.values .begin ());
515
515
}
516
516
517
- _LIBCPP_HIDE_FROM_ABI const_iterator begin () const noexcept {
517
+ _LIBCPP_HIDE_FROM_ABI const_iterator begin () const noexcept _LIBCPP_LIFETIMEBOUND {
518
518
return const_iterator (__containers_.keys .begin (), __containers_.values .begin ());
519
519
}
520
520
521
- _LIBCPP_HIDE_FROM_ABI iterator end () noexcept {
521
+ _LIBCPP_HIDE_FROM_ABI iterator end () noexcept _LIBCPP_LIFETIMEBOUND {
522
522
return iterator (__containers_.keys .end (), __containers_.values .end ());
523
523
}
524
524
525
- _LIBCPP_HIDE_FROM_ABI const_iterator end () const noexcept {
525
+ _LIBCPP_HIDE_FROM_ABI const_iterator end () const noexcept _LIBCPP_LIFETIMEBOUND {
526
526
return const_iterator (__containers_.keys .end (), __containers_.values .end ());
527
527
}
528
528
529
- _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin () noexcept { return reverse_iterator (end ()); }
530
- _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin () const noexcept { return const_reverse_iterator (end ()); }
531
- _LIBCPP_HIDE_FROM_ABI reverse_iterator rend () noexcept { return reverse_iterator (begin ()); }
532
- _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend () const noexcept { return const_reverse_iterator (begin ()); }
529
+ _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin () noexcept _LIBCPP_LIFETIMEBOUND { return reverse_iterator (end ()); }
530
+ _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin () const noexcept _LIBCPP_LIFETIMEBOUND { return const_reverse_iterator (end ()); }
531
+ _LIBCPP_HIDE_FROM_ABI reverse_iterator rend () noexcept _LIBCPP_LIFETIMEBOUND { return reverse_iterator (begin ()); }
532
+ _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend () const noexcept _LIBCPP_LIFETIMEBOUND { return const_reverse_iterator (begin ()); }
533
533
534
- _LIBCPP_HIDE_FROM_ABI const_iterator cbegin () const noexcept { return begin (); }
535
- _LIBCPP_HIDE_FROM_ABI const_iterator cend () const noexcept { return end (); }
536
- _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin () const noexcept { return const_reverse_iterator (end ()); }
537
- _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend () const noexcept { return const_reverse_iterator (begin ()); }
534
+ _LIBCPP_HIDE_FROM_ABI const_iterator cbegin () const noexcept _LIBCPP_LIFETIMEBOUND { return begin (); }
535
+ _LIBCPP_HIDE_FROM_ABI const_iterator cend () const noexcept _LIBCPP_LIFETIMEBOUND { return end (); }
536
+ _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin () const noexcept _LIBCPP_LIFETIMEBOUND { return const_reverse_iterator (end ()); }
537
+ _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend () const noexcept _LIBCPP_LIFETIMEBOUND { return const_reverse_iterator (begin ()); }
538
538
539
539
// [flat.map.capacity], capacity
540
540
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI bool empty () const noexcept { return __containers_.keys .empty (); }
@@ -565,15 +565,15 @@ class flat_map {
565
565
return try_emplace (std::forward<_Kp>(__x)).first ->second ;
566
566
}
567
567
568
- _LIBCPP_HIDE_FROM_ABI mapped_type& at (const key_type& __x) {
568
+ _LIBCPP_HIDE_FROM_ABI mapped_type& at (const key_type& __x) _LIBCPP_LIFETIMEBOUND {
569
569
auto __it = find (__x);
570
570
if (__it == end ()) {
571
571
std::__throw_out_of_range (" flat_map::at(const key_type&): Key does not exist" );
572
572
}
573
573
return __it->second ;
574
574
}
575
575
576
- _LIBCPP_HIDE_FROM_ABI const mapped_type& at (const key_type& __x) const {
576
+ _LIBCPP_HIDE_FROM_ABI const mapped_type& at (const key_type& __x) const _LIBCPP_LIFETIMEBOUND {
577
577
auto __it = find (__x);
578
578
if (__it == end ()) {
579
579
std::__throw_out_of_range (" flat_map::at(const key_type&) const: Key does not exist" );
@@ -583,7 +583,7 @@ class flat_map {
583
583
584
584
template <class _Kp >
585
585
requires __is_compare_transparent
586
- _LIBCPP_HIDE_FROM_ABI mapped_type& at (const _Kp& __x) {
586
+ _LIBCPP_HIDE_FROM_ABI mapped_type& at (const _Kp& __x) _LIBCPP_LIFETIMEBOUND {
587
587
auto __it = find (__x);
588
588
if (__it == end ()) {
589
589
std::__throw_out_of_range (" flat_map::at(const K&): Key does not exist" );
@@ -593,7 +593,7 @@ class flat_map {
593
593
594
594
template <class _Kp >
595
595
requires __is_compare_transparent
596
- _LIBCPP_HIDE_FROM_ABI const mapped_type& at (const _Kp& __x) const {
596
+ _LIBCPP_HIDE_FROM_ABI const mapped_type& at (const _Kp& __x) const _LIBCPP_LIFETIMEBOUND {
597
597
auto __it = find (__x);
598
598
if (__it == end ()) {
599
599
std::__throw_out_of_range (" flat_map::at(const K&) const: Key does not exist" );
@@ -604,39 +604,39 @@ class flat_map {
604
604
// [flat.map.modifiers], modifiers
605
605
template <class ... _Args>
606
606
requires is_constructible_v<pair<key_type, mapped_type>, _Args...>
607
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool > emplace (_Args&&... __args) {
607
+ _LIBCPP_HIDE_FROM_ABI pair<iterator, bool > emplace (_Args&&... __args) _LIBCPP_LIFETIMEBOUND {
608
608
std::pair<key_type, mapped_type> __pair (std::forward<_Args>(__args)...);
609
609
return __try_emplace (std::move (__pair.first ), std::move (__pair.second ));
610
610
}
611
611
612
612
template <class ... _Args>
613
613
requires is_constructible_v<pair<key_type, mapped_type>, _Args...>
614
- _LIBCPP_HIDE_FROM_ABI iterator emplace_hint (const_iterator __hint, _Args&&... __args) {
614
+ _LIBCPP_HIDE_FROM_ABI iterator emplace_hint (const_iterator __hint, _Args&&... __args) _LIBCPP_LIFETIMEBOUND {
615
615
std::pair<key_type, mapped_type> __pair (std::forward<_Args>(__args)...);
616
616
return __try_emplace_hint (__hint, std::move (__pair.first ), std::move (__pair.second )).first ;
617
617
}
618
618
619
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool > insert (const value_type& __x) { return emplace (__x); }
619
+ _LIBCPP_HIDE_FROM_ABI pair<iterator, bool > insert (const value_type& __x) _LIBCPP_LIFETIMEBOUND { return emplace (__x); }
620
620
621
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool > insert (value_type&& __x) { return emplace (std::move (__x)); }
621
+ _LIBCPP_HIDE_FROM_ABI pair<iterator, bool > insert (value_type&& __x) _LIBCPP_LIFETIMEBOUND { return emplace (std::move (__x)); }
622
622
623
- _LIBCPP_HIDE_FROM_ABI iterator insert (const_iterator __hint, const value_type& __x) {
623
+ _LIBCPP_HIDE_FROM_ABI iterator insert (const_iterator __hint, const value_type& __x) _LIBCPP_LIFETIMEBOUND {
624
624
return emplace_hint (__hint, __x);
625
625
}
626
626
627
- _LIBCPP_HIDE_FROM_ABI iterator insert (const_iterator __hint, value_type&& __x) {
627
+ _LIBCPP_HIDE_FROM_ABI iterator insert (const_iterator __hint, value_type&& __x) _LIBCPP_LIFETIMEBOUND {
628
628
return emplace_hint (__hint, std::move (__x));
629
629
}
630
630
631
631
template <class _Pp >
632
632
requires is_constructible_v<pair<key_type, mapped_type>, _Pp>
633
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool > insert (_Pp&& __x) {
633
+ _LIBCPP_HIDE_FROM_ABI pair<iterator, bool > insert (_Pp&& __x) _LIBCPP_LIFETIMEBOUND {
634
634
return emplace (std::forward<_Pp>(__x));
635
635
}
636
636
637
637
template <class _Pp >
638
638
requires is_constructible_v<pair<key_type, mapped_type>, _Pp>
639
- _LIBCPP_HIDE_FROM_ABI iterator insert (const_iterator __hint, _Pp&& __x) {
639
+ _LIBCPP_HIDE_FROM_ABI iterator insert (const_iterator __hint, _Pp&& __x) _LIBCPP_LIFETIMEBOUND {
640
640
return emplace_hint (__hint, std::forward<_Pp>(__x));
641
641
}
642
642
@@ -732,47 +732,47 @@ class flat_map {
732
732
733
733
template <class _Mapped >
734
734
requires is_assignable_v<mapped_type&, _Mapped> && is_constructible_v<mapped_type, _Mapped>
735
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool > insert_or_assign (const key_type& __key, _Mapped&& __obj) {
735
+ _LIBCPP_HIDE_FROM_ABI pair<iterator, bool > insert_or_assign (const key_type& __key, _Mapped&& __obj) _LIBCPP_LIFETIMEBOUND {
736
736
return __insert_or_assign (__key, std::forward<_Mapped>(__obj));
737
737
}
738
738
739
739
template <class _Mapped >
740
740
requires is_assignable_v<mapped_type&, _Mapped> && is_constructible_v<mapped_type, _Mapped>
741
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool > insert_or_assign (key_type&& __key, _Mapped&& __obj) {
741
+ _LIBCPP_HIDE_FROM_ABI pair<iterator, bool > insert_or_assign (key_type&& __key, _Mapped&& __obj) _LIBCPP_LIFETIMEBOUND {
742
742
return __insert_or_assign (std::move (__key), std::forward<_Mapped>(__obj));
743
743
}
744
744
745
745
template <class _Kp , class _Mapped >
746
746
requires __is_compare_transparent && is_constructible_v<key_type, _Kp> && is_assignable_v<mapped_type&, _Mapped> &&
747
747
is_constructible_v<mapped_type, _Mapped>
748
- _LIBCPP_HIDE_FROM_ABI pair<iterator, bool > insert_or_assign (_Kp&& __key, _Mapped&& __obj) {
748
+ _LIBCPP_HIDE_FROM_ABI pair<iterator, bool > insert_or_assign (_Kp&& __key, _Mapped&& __obj) _LIBCPP_LIFETIMEBOUND {
749
749
return __insert_or_assign (std::forward<_Kp>(__key), std::forward<_Mapped>(__obj));
750
750
}
751
751
752
752
template <class _Mapped >
753
753
requires is_assignable_v<mapped_type&, _Mapped> && is_constructible_v<mapped_type, _Mapped>
754
- _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign (const_iterator __hint, const key_type& __key, _Mapped&& __obj) {
754
+ _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign (const_iterator __hint, const key_type& __key, _Mapped&& __obj) _LIBCPP_LIFETIMEBOUND {
755
755
return __insert_or_assign (__hint, __key, std::forward<_Mapped>(__obj));
756
756
}
757
757
758
758
template <class _Mapped >
759
759
requires is_assignable_v<mapped_type&, _Mapped> && is_constructible_v<mapped_type, _Mapped>
760
- _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign (const_iterator __hint, key_type&& __key, _Mapped&& __obj) {
760
+ _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign (const_iterator __hint, key_type&& __key, _Mapped&& __obj) _LIBCPP_LIFETIMEBOUND {
761
761
return __insert_or_assign (__hint, std::move (__key), std::forward<_Mapped>(__obj));
762
762
}
763
763
764
764
template <class _Kp , class _Mapped >
765
765
requires __is_compare_transparent && is_constructible_v<key_type, _Kp> && is_assignable_v<mapped_type&, _Mapped> &&
766
766
is_constructible_v<mapped_type, _Mapped>
767
- _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign (const_iterator __hint, _Kp&& __key, _Mapped&& __obj) {
767
+ _LIBCPP_HIDE_FROM_ABI iterator insert_or_assign (const_iterator __hint, _Kp&& __key, _Mapped&& __obj) _LIBCPP_LIFETIMEBOUND {
768
768
return __insert_or_assign (__hint, std::forward<_Kp>(__key), std::forward<_Mapped>(__obj));
769
769
}
770
770
771
- _LIBCPP_HIDE_FROM_ABI iterator erase (iterator __position) {
771
+ _LIBCPP_HIDE_FROM_ABI iterator erase (iterator __position) _LIBCPP_LIFETIMEBOUND {
772
772
return __erase (__position.__key_iter_ , __position.__mapped_iter_ );
773
773
}
774
774
775
- _LIBCPP_HIDE_FROM_ABI iterator erase (const_iterator __position) {
775
+ _LIBCPP_HIDE_FROM_ABI iterator erase (const_iterator __position) _LIBCPP_LIFETIMEBOUND {
776
776
return __erase (__position.__key_iter_ , __position.__mapped_iter_ );
777
777
}
778
778
@@ -795,7 +795,7 @@ class flat_map {
795
795
return __res;
796
796
}
797
797
798
- _LIBCPP_HIDE_FROM_ABI iterator erase (const_iterator __first, const_iterator __last) {
798
+ _LIBCPP_HIDE_FROM_ABI iterator erase (const_iterator __first, const_iterator __last) _LIBCPP_LIFETIMEBOUND {
799
799
auto __on_failure = std::__make_exception_guard ([&]() noexcept { clear () /* noexcept */ ; });
800
800
auto __key_it = __containers_.keys .erase (__first.__key_iter_ , __last.__key_iter_ );
801
801
auto __mapped_it = __containers_.values .erase (__first.__mapped_iter_ , __last.__mapped_iter_ );
@@ -826,19 +826,19 @@ class flat_map {
826
826
_LIBCPP_HIDE_FROM_ABI const mapped_container_type& values () const noexcept { return __containers_.values ; }
827
827
828
828
// map operations
829
- _LIBCPP_HIDE_FROM_ABI iterator find (const key_type& __x) { return __find_impl (*this , __x); }
829
+ _LIBCPP_HIDE_FROM_ABI iterator find (const key_type& __x) _LIBCPP_LIFETIMEBOUND { return __find_impl (*this , __x); }
830
830
831
- _LIBCPP_HIDE_FROM_ABI const_iterator find (const key_type& __x) const { return __find_impl (*this , __x); }
831
+ _LIBCPP_HIDE_FROM_ABI const_iterator find (const key_type& __x) const _LIBCPP_LIFETIMEBOUND { return __find_impl (*this , __x); }
832
832
833
833
template <class _Kp >
834
834
requires __is_compare_transparent
835
- _LIBCPP_HIDE_FROM_ABI iterator find (const _Kp& __x) {
835
+ _LIBCPP_HIDE_FROM_ABI iterator find (const _Kp& __x) _LIBCPP_LIFETIMEBOUND {
836
836
return __find_impl (*this , __x);
837
837
}
838
838
839
839
template <class _Kp >
840
840
requires __is_compare_transparent
841
- _LIBCPP_HIDE_FROM_ABI const_iterator find (const _Kp& __x) const {
841
+ _LIBCPP_HIDE_FROM_ABI const_iterator find (const _Kp& __x) const _LIBCPP_LIFETIMEBOUND {
842
842
return __find_impl (*this , __x);
843
843
}
844
844
@@ -858,58 +858,58 @@ class flat_map {
858
858
return find (__x) != end ();
859
859
}
860
860
861
- _LIBCPP_HIDE_FROM_ABI iterator lower_bound (const key_type& __x) { return __lower_bound<iterator>(*this , __x); }
861
+ _LIBCPP_HIDE_FROM_ABI iterator lower_bound (const key_type& __x) _LIBCPP_LIFETIMEBOUND { return __lower_bound<iterator>(*this , __x); }
862
862
863
- _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound (const key_type& __x) const {
863
+ _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound (const key_type& __x) const _LIBCPP_LIFETIMEBOUND {
864
864
return __lower_bound<const_iterator>(*this , __x);
865
865
}
866
866
867
867
template <class _Kp >
868
868
requires __is_compare_transparent
869
- _LIBCPP_HIDE_FROM_ABI iterator lower_bound (const _Kp& __x) {
869
+ _LIBCPP_HIDE_FROM_ABI iterator lower_bound (const _Kp& __x) _LIBCPP_LIFETIMEBOUND {
870
870
return __lower_bound<iterator>(*this , __x);
871
871
}
872
872
873
873
template <class _Kp >
874
874
requires __is_compare_transparent
875
- _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound (const _Kp& __x) const {
875
+ _LIBCPP_HIDE_FROM_ABI const_iterator lower_bound (const _Kp& __x) const _LIBCPP_LIFETIMEBOUND {
876
876
return __lower_bound<const_iterator>(*this , __x);
877
877
}
878
878
879
- _LIBCPP_HIDE_FROM_ABI iterator upper_bound (const key_type& __x) { return __upper_bound<iterator>(*this , __x); }
879
+ _LIBCPP_HIDE_FROM_ABI iterator upper_bound (const key_type& __x) _LIBCPP_LIFETIMEBOUND { return __upper_bound<iterator>(*this , __x); }
880
880
881
- _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound (const key_type& __x) const {
881
+ _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound (const key_type& __x) const _LIBCPP_LIFETIMEBOUND {
882
882
return __upper_bound<const_iterator>(*this , __x);
883
883
}
884
884
885
885
template <class _Kp >
886
886
requires __is_compare_transparent
887
- _LIBCPP_HIDE_FROM_ABI iterator upper_bound (const _Kp& __x) {
887
+ _LIBCPP_HIDE_FROM_ABI iterator upper_bound (const _Kp& __x) _LIBCPP_LIFETIMEBOUND {
888
888
return __upper_bound<iterator>(*this , __x);
889
889
}
890
890
891
891
template <class _Kp >
892
892
requires __is_compare_transparent
893
- _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound (const _Kp& __x) const {
893
+ _LIBCPP_HIDE_FROM_ABI const_iterator upper_bound (const _Kp& __x) const _LIBCPP_LIFETIMEBOUND {
894
894
return __upper_bound<const_iterator>(*this , __x);
895
895
}
896
896
897
- _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range (const key_type& __x) {
897
+ _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range (const key_type& __x) _LIBCPP_LIFETIMEBOUND {
898
898
return __equal_range_impl (*this , __x);
899
899
}
900
900
901
- _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range (const key_type& __x) const {
901
+ _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range (const key_type& __x) const _LIBCPP_LIFETIMEBOUND {
902
902
return __equal_range_impl (*this , __x);
903
903
}
904
904
905
905
template <class _Kp >
906
906
requires __is_compare_transparent
907
- _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range (const _Kp& __x) {
907
+ _LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range (const _Kp& __x) _LIBCPP_LIFETIMEBOUND {
908
908
return __equal_range_impl (*this , __x);
909
909
}
910
910
template <class _Kp >
911
911
requires __is_compare_transparent
912
- _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range (const _Kp& __x) const {
912
+ _LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range (const _Kp& __x) const _LIBCPP_LIFETIMEBOUND {
913
913
return __equal_range_impl (*this , __x);
914
914
}
915
915
0 commit comments