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