Skip to content

Commit 457ae75

Browse files
add more macros
1 parent ed3b843 commit 457ae75

File tree

1 file changed

+65
-44
lines changed

1 file changed

+65
-44
lines changed

libcxx/include/deque

Lines changed: 65 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,8 @@ private:
605605

606606
public:
607607
// construct/copy/destroy:
608-
_LIBCPP_HIDE_FROM_ABI deque() _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
608+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque()
609+
_NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
609610
: __start_(0), __size_(0) {
610611
__annotate_new(0);
611612
}
@@ -619,19 +620,20 @@ public:
619620
__alloc_traits::deallocate(__alloc(), *__i, __block_size);
620621
}
621622

622-
_LIBCPP_HIDE_FROM_ABI explicit deque(const allocator_type& __a)
623+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit deque(const allocator_type& __a)
623624
: __map_(__pointer_allocator(__a)), __start_(0), __size_(0), __alloc_(__a) {
624625
__annotate_new(0);
625626
}
626627

627628
explicit _LIBCPP_HIDE_FROM_ABI deque(size_type __n);
628629
# if _LIBCPP_STD_VER >= 14
629-
explicit _LIBCPP_HIDE_FROM_ABI deque(size_type __n, const _Allocator& __a);
630+
explicit _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque(size_type __n, const _Allocator& __a);
630631
# endif
631632
_LIBCPP_HIDE_FROM_ABI deque(size_type __n, const value_type& __v);
632633

633634
template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
634-
_LIBCPP_HIDE_FROM_ABI deque(size_type __n, const value_type& __v, const allocator_type& __a)
635+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
636+
deque(size_type __n, const value_type& __v, const allocator_type& __a)
635637
: __map_(__pointer_allocator(__a)), __start_(0), __size_(0), __alloc_(__a) {
636638
__annotate_new(0);
637639
if (__n > 0)
@@ -641,11 +643,12 @@ public:
641643
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> = 0>
642644
_LIBCPP_HIDE_FROM_ABI deque(_InputIter __f, _InputIter __l);
643645
template <class _InputIter, __enable_if_t<__has_input_iterator_category<_InputIter>::value, int> = 0>
644-
_LIBCPP_HIDE_FROM_ABI deque(_InputIter __f, _InputIter __l, const allocator_type& __a);
646+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque(_InputIter __f, _InputIter __l, const allocator_type& __a);
645647

646648
# if _LIBCPP_STD_VER >= 23
647649
template <_ContainerCompatibleRange<_Tp> _Range>
648-
_LIBCPP_HIDE_FROM_ABI deque(from_range_t, _Range&& __range, const allocator_type& __a = allocator_type())
650+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
651+
deque(from_range_t, _Range&& __range, const allocator_type& __a = allocator_type())
649652
: __map_(__pointer_allocator(__a)), __start_(0), __size_(0), __alloc_(__a) {
650653
if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
651654
__append_with_size(ranges::begin(__range), ranges::distance(__range));
@@ -658,22 +661,24 @@ public:
658661
}
659662
# endif
660663

661-
_LIBCPP_HIDE_FROM_ABI deque(const deque& __c);
662-
_LIBCPP_HIDE_FROM_ABI deque(const deque& __c, const __type_identity_t<allocator_type>& __a);
664+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque(const deque& __c);
665+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
666+
deque(const deque& __c, const __type_identity_t<allocator_type>& __a);
663667

664668
_LIBCPP_HIDE_FROM_ABI deque& operator=(const deque& __c);
665669

666670
# ifndef _LIBCPP_CXX03_LANG
667671
_LIBCPP_HIDE_FROM_ABI deque(initializer_list<value_type> __il);
668672
_LIBCPP_HIDE_FROM_ABI deque(initializer_list<value_type> __il, const allocator_type& __a);
669673

670-
_LIBCPP_HIDE_FROM_ABI deque& operator=(initializer_list<value_type> __il) {
674+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque& operator=(initializer_list<value_type> __il) {
671675
assign(__il);
672676
return *this;
673677
}
674678

675-
_LIBCPP_HIDE_FROM_ABI deque(deque&& __c) noexcept(is_nothrow_move_constructible<allocator_type>::value);
676-
_LIBCPP_HIDE_FROM_ABI deque(deque&& __c, const __type_identity_t<allocator_type>& __a);
679+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26
680+
deque(deque&& __c) noexcept(is_nothrow_move_constructible<allocator_type>::value);
681+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 deque(deque&& __c, const __type_identity_t<allocator_type>& __a);
677682
_LIBCPP_HIDE_FROM_ABI deque& operator=(deque&& __c) noexcept(
678683
(__alloc_traits::propagate_on_container_move_assignment::value &&
679684
is_nothrow_move_assignable<allocator_type>::value) ||
@@ -709,67 +714,81 @@ public:
709714

710715
_LIBCPP_HIDE_FROM_ABI void assign(size_type __n, const value_type& __v);
711716

712-
_LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT;
717+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 allocator_type get_allocator() const _NOEXCEPT;
713718
_LIBCPP_HIDE_FROM_ABI allocator_type& __alloc() _NOEXCEPT { return __alloc_; }
714719
_LIBCPP_HIDE_FROM_ABI const allocator_type& __alloc() const _NOEXCEPT { return __alloc_; }
715720

716721
// iterators:
717722

718-
_LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT {
723+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator begin() _NOEXCEPT {
719724
__map_pointer __mp = __map_.begin() + __start_ / __block_size;
720725
return iterator(__mp, __map_.empty() ? 0 : *__mp + __start_ % __block_size);
721726
}
722727

723-
_LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {
728+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator begin() const _NOEXCEPT {
724729
__map_const_pointer __mp = static_cast<__map_const_pointer>(__map_.begin() + __start_ / __block_size);
725730
return const_iterator(__mp, __map_.empty() ? 0 : *__mp + __start_ % __block_size);
726731
}
727732

728-
_LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT {
733+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator end() _NOEXCEPT {
729734
size_type __p = size() + __start_;
730735
__map_pointer __mp = __map_.begin() + __p / __block_size;
731736
return iterator(__mp, __map_.empty() ? 0 : *__mp + __p % __block_size);
732737
}
733738

734-
_LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT {
739+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator end() const _NOEXCEPT {
735740
size_type __p = size() + __start_;
736741
__map_const_pointer __mp = static_cast<__map_const_pointer>(__map_.begin() + __p / __block_size);
737742
return const_iterator(__mp, __map_.empty() ? 0 : *__mp + __p % __block_size);
738743
}
739744

740-
_LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT { return reverse_iterator(end()); }
741-
_LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(end()); }
742-
_LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT { return reverse_iterator(begin()); }
743-
_LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT { return const_reverse_iterator(begin()); }
745+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rbegin() _NOEXCEPT {
746+
return reverse_iterator(end());
747+
}
748+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rbegin() const _NOEXCEPT {
749+
return const_reverse_iterator(end());
750+
}
751+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reverse_iterator rend() _NOEXCEPT {
752+
return reverse_iterator(begin());
753+
}
754+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator rend() const _NOEXCEPT {
755+
return const_reverse_iterator(begin());
756+
}
744757

745-
_LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }
746-
_LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }
747-
_LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT { return const_reverse_iterator(end()); }
748-
_LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return const_reverse_iterator(begin()); }
758+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cbegin() const _NOEXCEPT { return begin(); }
759+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator cend() const _NOEXCEPT { return end(); }
760+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crbegin() const _NOEXCEPT {
761+
return const_reverse_iterator(end());
762+
}
763+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reverse_iterator crend() const _NOEXCEPT {
764+
return const_reverse_iterator(begin());
765+
}
749766

750767
// capacity:
751-
_LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT { return __size(); }
768+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type size() const _NOEXCEPT { return __size(); }
752769

753770
_LIBCPP_HIDE_FROM_ABI size_type& __size() _NOEXCEPT { return __size_; }
754771
_LIBCPP_HIDE_FROM_ABI const size_type& __size() const _NOEXCEPT { return __size_; }
755772

756-
_LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {
773+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 size_type max_size() const _NOEXCEPT {
757774
return std::min<size_type>(__alloc_traits::max_size(__alloc()), numeric_limits<difference_type>::max());
758775
}
759-
_LIBCPP_HIDE_FROM_ABI void resize(size_type __n);
760-
_LIBCPP_HIDE_FROM_ABI void resize(size_type __n, const value_type& __v);
761-
_LIBCPP_HIDE_FROM_ABI void shrink_to_fit() _NOEXCEPT;
762-
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT { return size() == 0; }
776+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void resize(size_type __n);
777+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void resize(size_type __n, const value_type& __v);
778+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void shrink_to_fit() _NOEXCEPT;
779+
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool empty() const _NOEXCEPT {
780+
return size() == 0;
781+
}
763782

764783
// element access:
765-
_LIBCPP_HIDE_FROM_ABI reference operator[](size_type __i) _NOEXCEPT;
766-
_LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __i) const _NOEXCEPT;
767-
_LIBCPP_HIDE_FROM_ABI reference at(size_type __i);
768-
_LIBCPP_HIDE_FROM_ABI const_reference at(size_type __i) const;
769-
_LIBCPP_HIDE_FROM_ABI reference front() _NOEXCEPT;
770-
_LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT;
771-
_LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT;
772-
_LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT;
784+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference operator[](size_type __i) _NOEXCEPT;
785+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reference operator[](size_type __i) const _NOEXCEPT;
786+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference at(size_type __i);
787+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reference at(size_type __i) const;
788+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference front() _NOEXCEPT;
789+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reference front() const _NOEXCEPT;
790+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 reference back() _NOEXCEPT;
791+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_reference back() const _NOEXCEPT;
773792

774793
// 23.2.2.3 modifiers:
775794
_LIBCPP_HIDE_FROM_ABI void push_front(const value_type& __v);
@@ -789,8 +808,8 @@ public:
789808
template <class... _Args>
790809
_LIBCPP_HIDE_FROM_ABI iterator emplace(const_iterator __p, _Args&&... __args);
791810

792-
_LIBCPP_HIDE_FROM_ABI void push_front(value_type&& __v);
793-
_LIBCPP_HIDE_FROM_ABI void push_back(value_type&& __v);
811+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void push_front(value_type&& __v);
812+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 void push_back(value_type&& __v);
794813

795814
# if _LIBCPP_STD_VER >= 23
796815
template <_ContainerCompatibleRange<_Tp> _Range>
@@ -1570,7 +1589,7 @@ inline typename deque<_Tp, _Allocator>::const_reference deque<_Tp, _Allocator>::
15701589
}
15711590

15721591
template <class _Tp, class _Allocator>
1573-
void deque<_Tp, _Allocator>::push_back(const value_type& __v) {
1592+
void _LIBCPP_CONSTEXPR_SINCE_CXX26 deque<_Tp, _Allocator>::push_back(const value_type& __v) {
15741593
allocator_type& __a = __alloc();
15751594
if (__back_spare() == 0)
15761595
__add_back_capacity();
@@ -1658,7 +1677,8 @@ deque<_Tp, _Allocator>::emplace_front(_Args&&... __args) {
16581677
}
16591678

16601679
template <class _Tp, class _Allocator>
1661-
typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v) {
1680+
_LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator
1681+
deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v) {
16621682
size_type __pos = __p - begin();
16631683
size_type __to_end = size() - __pos;
16641684
allocator_type& __a = __alloc();
@@ -1755,7 +1775,8 @@ typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::emplace(const_
17551775
# endif // _LIBCPP_CXX03_LANG
17561776

17571777
template <class _Tp, class _Allocator>
1758-
typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v) {
1778+
_LIBCPP_CONSTEXPR_SINCE_CXX26 typename deque<_Tp, _Allocator>::iterator
1779+
deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v) {
17591780
size_type __pos = __p - begin();
17601781
size_type __to_end = size() - __pos;
17611782
allocator_type& __a = __alloc();
@@ -1807,7 +1828,7 @@ typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::insert(const_i
18071828
}
18081829

18091830
template <class _Tp, class _Allocator>
1810-
typename deque<_Tp, _Allocator>::iterator
1831+
typename deque<_Tp, _Allocator>::iterator _LIBCPP_CONSTEXPR_SINCE_CXX26
18111832
deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_type& __v) {
18121833
size_type __pos = __p - begin();
18131834
size_type __to_end = __size() - __pos;

0 commit comments

Comments
 (0)