diff --git a/libcxx/include/__split_buffer b/libcxx/include/__split_buffer --- a/libcxx/include/__split_buffer +++ b/libcxx/include/__split_buffer @@ -53,67 +53,68 @@ typedef typename add_lvalue_reference::type __alloc_ref; typedef typename add_lvalue_reference::type __alloc_const_ref; - _LIBCPP_INLINE_VISIBILITY __alloc_rr& __alloc() _NOEXCEPT {return __end_cap_.second();} - _LIBCPP_INLINE_VISIBILITY const __alloc_rr& __alloc() const _NOEXCEPT {return __end_cap_.second();} - _LIBCPP_INLINE_VISIBILITY pointer& __end_cap() _NOEXCEPT {return __end_cap_.first();} - _LIBCPP_INLINE_VISIBILITY const pointer& __end_cap() const _NOEXCEPT {return __end_cap_.first();} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY __alloc_rr& __alloc() _NOEXCEPT {return __end_cap_.second();} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const __alloc_rr& __alloc() const _NOEXCEPT {return __end_cap_.second();} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY pointer& __end_cap() _NOEXCEPT {return __end_cap_.first();} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const pointer& __end_cap() const _NOEXCEPT {return __end_cap_.first();} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY __split_buffer() _NOEXCEPT_(is_nothrow_default_constructible::value); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY explicit __split_buffer(__alloc_rr& __a); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY explicit __split_buffer(const __alloc_rr& __a); - __split_buffer(size_type __cap, size_type __start, __alloc_rr& __a); - ~__split_buffer(); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC __split_buffer(size_type __cap, size_type __start, __alloc_rr& __a); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC ~__split_buffer(); #ifndef _LIBCPP_CXX03_LANG - __split_buffer(__split_buffer&& __c) + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC __split_buffer(__split_buffer&& __c) _NOEXCEPT_(is_nothrow_move_constructible::value); - __split_buffer(__split_buffer&& __c, const __alloc_rr& __a); - __split_buffer& operator=(__split_buffer&& __c) + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC __split_buffer(__split_buffer&& __c, const __alloc_rr& __a); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC __split_buffer& operator=(__split_buffer&& __c) _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value && is_nothrow_move_assignable::value) || !__alloc_traits::propagate_on_container_move_assignment::value); #endif // _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY iterator begin() _NOEXCEPT {return __begin_;} - _LIBCPP_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT {return __begin_;} - _LIBCPP_INLINE_VISIBILITY iterator end() _NOEXCEPT {return __end_;} - _LIBCPP_INLINE_VISIBILITY const_iterator end() const _NOEXCEPT {return __end_;} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY iterator begin() _NOEXCEPT {return __begin_;} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT {return __begin_;} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY iterator end() _NOEXCEPT {return __end_;} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const_iterator end() const _NOEXCEPT {return __end_;} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void clear() _NOEXCEPT {__destruct_at_end(__begin_);} - _LIBCPP_INLINE_VISIBILITY size_type size() const {return static_cast(__end_ - __begin_);} - _LIBCPP_INLINE_VISIBILITY bool empty() const {return __end_ == __begin_;} - _LIBCPP_INLINE_VISIBILITY size_type capacity() const {return static_cast(__end_cap() - __first_);} - _LIBCPP_INLINE_VISIBILITY size_type __front_spare() const {return static_cast(__begin_ - __first_);} - _LIBCPP_INLINE_VISIBILITY size_type __back_spare() const {return static_cast(__end_cap() - __end_);} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY size_type size() const {return static_cast(__end_ - __begin_);} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY bool empty() const {return __end_ == __begin_;} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY size_type capacity() const {return static_cast(__end_cap() - __first_);} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY size_type __front_spare() const {return static_cast(__begin_ - __first_);} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY size_type __back_spare() const {return static_cast(__end_cap() - __end_);} - _LIBCPP_INLINE_VISIBILITY reference front() {return *__begin_;} - _LIBCPP_INLINE_VISIBILITY const_reference front() const {return *__begin_;} - _LIBCPP_INLINE_VISIBILITY reference back() {return *(__end_ - 1);} - _LIBCPP_INLINE_VISIBILITY const_reference back() const {return *(__end_ - 1);} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY reference front() {return *__begin_;} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const_reference front() const {return *__begin_;} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY reference back() {return *(__end_ - 1);} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const_reference back() const {return *(__end_ - 1);} - void reserve(size_type __n); - void shrink_to_fit() _NOEXCEPT; - void push_front(const_reference __x); - _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void reserve(size_type __n); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void shrink_to_fit() _NOEXCEPT; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void push_front(const_reference __x); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x); #ifndef _LIBCPP_CXX03_LANG - void push_front(value_type&& __x); - void push_back(value_type&& __x); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void push_front(value_type&& __x); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void push_back(value_type&& __x); template - void emplace_back(_Args&&... __args); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void emplace_back(_Args&&... __args); #endif // !defined(_LIBCPP_CXX03_LANG) - _LIBCPP_INLINE_VISIBILITY void pop_front() {__destruct_at_begin(__begin_+1);} - _LIBCPP_INLINE_VISIBILITY void pop_back() {__destruct_at_end(__end_-1);} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void pop_front() {__destruct_at_begin(__begin_+1);} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void pop_back() {__destruct_at_end(__end_-1);} - void __construct_at_end(size_type __n); - void __construct_at_end(size_type __n, const_reference __x); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __construct_at_end(size_type __n); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __construct_at_end(size_type __n, const_reference __x); template + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename enable_if < __is_input_iterator<_InputIter>::value && @@ -122,6 +123,7 @@ >::type __construct_at_end(_InputIter __first, _InputIter __last); template + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename enable_if < __is_forward_iterator<_ForwardIterator>::value, @@ -129,44 +131,44 @@ >::type __construct_at_end(_ForwardIterator __first, _ForwardIterator __last); - _LIBCPP_INLINE_VISIBILITY void __destruct_at_begin(pointer __new_begin) + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __destruct_at_begin(pointer __new_begin) {__destruct_at_begin(__new_begin, is_trivially_destructible());} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __destruct_at_begin(pointer __new_begin, false_type); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __destruct_at_begin(pointer __new_begin, true_type); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __destruct_at_end(pointer __new_last) _NOEXCEPT {__destruct_at_end(__new_last, false_type());} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __destruct_at_end(pointer __new_last, false_type) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __destruct_at_end(pointer __new_last, true_type) _NOEXCEPT; - void swap(__split_buffer& __x) + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void swap(__split_buffer& __x) _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value|| __is_nothrow_swappable<__alloc_rr>::value); - bool __invariants() const; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC bool __invariants() const; private: - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __move_assign_alloc(__split_buffer& __c, true_type) _NOEXCEPT_(is_nothrow_move_assignable::value) { __alloc() = _VSTD::move(__c.__alloc()); } - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __move_assign_alloc(__split_buffer&, false_type) _NOEXCEPT {} struct _ConstructTransaction { - explicit _ConstructTransaction(pointer* __p, size_type __n) _NOEXCEPT + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC explicit _ConstructTransaction(pointer* __p, size_type __n) _NOEXCEPT : __pos_(*__p), __end_(*__p + __n), __dest_(__p) { } - ~_ConstructTransaction() { + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC ~_ConstructTransaction() { *__dest_ = __pos_; } pointer __pos_; @@ -177,6 +179,7 @@ }; template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC bool __split_buffer<_Tp, _Allocator>::__invariants() const { @@ -207,6 +210,7 @@ // Precondition: size() + __n <= capacity() // Postcondition: size() == size() + __n template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n) { @@ -223,6 +227,7 @@ // Postcondition: size() == old size() + __n // Postcondition: [i] == __x for all i in [size() - __n, __n) template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n, const_reference __x) { @@ -235,6 +240,7 @@ template template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename enable_if < __is_input_iterator<_InputIter>::value && @@ -263,6 +269,7 @@ template template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename enable_if < __is_forward_iterator<_ForwardIterator>::value, @@ -278,6 +285,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline void __split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, false_type) @@ -287,6 +295,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline void __split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, true_type) @@ -295,6 +304,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY void __split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT @@ -304,6 +314,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY void __split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, true_type) _NOEXCEPT @@ -312,6 +323,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC __split_buffer<_Tp, _Allocator>::__split_buffer(size_type __cap, size_type __start, __alloc_rr& __a) : __end_cap_(nullptr, __a) { @@ -321,6 +333,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline __split_buffer<_Tp, _Allocator>::__split_buffer() _NOEXCEPT_(is_nothrow_default_constructible::value) @@ -329,6 +342,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline __split_buffer<_Tp, _Allocator>::__split_buffer(__alloc_rr& __a) : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a) @@ -336,6 +350,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline __split_buffer<_Tp, _Allocator>::__split_buffer(const __alloc_rr& __a) : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a) @@ -343,6 +358,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC __split_buffer<_Tp, _Allocator>::~__split_buffer() { clear(); @@ -353,6 +369,7 @@ #ifndef _LIBCPP_CXX03_LANG template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c) _NOEXCEPT_(is_nothrow_move_constructible::value) : __first_(_VSTD::move(__c.__first_)), @@ -367,6 +384,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c, const __alloc_rr& __a) : __end_cap_(__second_tag(), __a) { @@ -393,6 +411,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC __split_buffer<_Tp, _Allocator>& __split_buffer<_Tp, _Allocator>::operator=(__split_buffer&& __c) _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value && @@ -415,6 +434,7 @@ #endif // _LIBCPP_CXX03_LANG template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __split_buffer<_Tp, _Allocator>::swap(__split_buffer& __x) _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value|| @@ -428,6 +448,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __split_buffer<_Tp, _Allocator>::reserve(size_type __n) { @@ -444,6 +465,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __split_buffer<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT { @@ -471,6 +493,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __split_buffer<_Tp, _Allocator>::push_front(const_reference __x) { @@ -502,6 +525,7 @@ #ifndef _LIBCPP_CXX03_LANG template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __split_buffer<_Tp, _Allocator>::push_front(value_type&& __x) { @@ -534,6 +558,7 @@ #endif // _LIBCPP_CXX03_LANG template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY void __split_buffer<_Tp, _Allocator>::push_back(const_reference __x) @@ -566,6 +591,7 @@ #ifndef _LIBCPP_CXX03_LANG template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __split_buffer<_Tp, _Allocator>::push_back(value_type&& __x) { @@ -597,6 +623,7 @@ template template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args) { @@ -629,6 +656,7 @@ #endif // _LIBCPP_CXX03_LANG template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY void swap(__split_buffer<_Tp, _Allocator>& __x, __split_buffer<_Tp, _Allocator>& __y) diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -1631,7 +1631,7 @@ // copy template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR _Iter __unwrap_iter(_Iter __i) { @@ -1639,7 +1639,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename enable_if < is_trivially_copy_assignable<_Tp>::value, @@ -1653,7 +1653,7 @@ #if _LIBCPP_DEBUG_LEVEL < 2 template -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename enable_if < is_trivially_copy_assignable<_Tp>::value, @@ -1665,7 +1665,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename enable_if < is_trivially_copy_assignable<_Tp>::value, @@ -1679,7 +1679,7 @@ #else template -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename enable_if < is_trivially_copy_assignable<_Tp>::value, @@ -1693,7 +1693,7 @@ #endif // _LIBCPP_DEBUG_LEVEL < 2 template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator __copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) { @@ -1703,7 +1703,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename enable_if < is_same::type, _Up>::value && @@ -1719,7 +1719,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) { @@ -1729,7 +1729,7 @@ // copy_backward template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator __copy_backward(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result) { @@ -1739,7 +1739,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename enable_if < is_same::type, _Up>::value && @@ -1758,7 +1758,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _BidirectionalIterator2 copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, _BidirectionalIterator2 __result) @@ -1771,7 +1771,7 @@ // copy_if template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _Predicate __pred) @@ -1790,7 +1790,7 @@ // copy_n template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename enable_if < __is_input_iterator<_InputIterator>::value && @@ -1816,7 +1816,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename enable_if < __is_random_access_iterator<_InputIterator>::value, @@ -1832,7 +1832,7 @@ // move template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator __move(_InputIterator __first, _InputIterator __last, _OutputIterator __result) { @@ -1842,7 +1842,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename enable_if < is_same::type, _Up>::value && @@ -1851,6 +1851,14 @@ >::type __move(_Tp* __first, _Tp* __last, _Up* __result) { +#ifndef _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED + if (__builtin_is_constant_evaluated()) + { + for (; __first != __last; ++__first, (void) ++__result) + *__result = _VSTD::move(*__first); + return __result; + } +#endif const size_t __n = static_cast(__last - __first); if (__n > 0) _VSTD::memmove(__result, __first, __n * sizeof(_Up)); @@ -1858,7 +1866,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator move(_InputIterator __first, _InputIterator __last, _OutputIterator __result) { @@ -1868,7 +1876,7 @@ // move_backward template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator __move_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result) { @@ -1878,7 +1886,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 typename enable_if < is_same::type, _Up>::value && @@ -1897,7 +1905,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 _BidirectionalIterator2 move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, _BidirectionalIterator2 __result) diff --git a/libcxx/include/iterator b/libcxx/include/iterator --- a/libcxx/include/iterator +++ b/libcxx/include/iterator @@ -1304,15 +1304,15 @@ __wrap_iter<_Iter> operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT; -template _Op _LIBCPP_INLINE_VISIBILITY copy(_Ip, _Ip, _Op); -template _B2 _LIBCPP_INLINE_VISIBILITY copy_backward(_B1, _B1, _B2); -template _Op _LIBCPP_INLINE_VISIBILITY move(_Ip, _Ip, _Op); -template _B2 _LIBCPP_INLINE_VISIBILITY move_backward(_B1, _B1, _B2); +template _Op _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 copy(_Ip, _Ip, _Op); +template _B2 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 copy_backward(_B1, _B1, _B2); +template _Op _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 move(_Ip, _Ip, _Op); +template _B2 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 move_backward(_B1, _B1, _B2); #if _LIBCPP_DEBUG_LEVEL < 2 template -_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename enable_if < is_trivially_copy_assignable<_Tp>::value, @@ -1323,7 +1323,7 @@ #else template -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename enable_if < is_trivially_copy_assignable<_Tp>::value, @@ -1515,14 +1515,14 @@ __wrap_iter<_Iter1> operator+(typename __wrap_iter<_Iter1>::difference_type, __wrap_iter<_Iter1>) _NOEXCEPT; - template friend _Op copy(_Ip, _Ip, _Op); - template friend _B2 copy_backward(_B1, _B1, _B2); - template friend _Op move(_Ip, _Ip, _Op); - template friend _B2 move_backward(_B1, _B1, _B2); + template friend _LIBCPP_CONSTEXPR_AFTER_CXX17 _Op copy(_Ip, _Ip, _Op); + template friend _LIBCPP_CONSTEXPR_AFTER_CXX17 _B2 copy_backward(_B1, _B1, _B2); + template friend _LIBCPP_CONSTEXPR_AFTER_CXX17 _Op move(_Ip, _Ip, _Op); + template friend _LIBCPP_CONSTEXPR_AFTER_CXX17 _B2 move_backward(_B1, _B1, _B2); #if _LIBCPP_DEBUG_LEVEL < 2 template - _LIBCPP_CONSTEXPR_IF_NODEBUG friend + _LIBCPP_CONSTEXPR friend typename enable_if < is_trivially_copy_assignable<_Tp>::value, @@ -1531,7 +1531,7 @@ __unwrap_iter(__wrap_iter<_Tp*>); #else template - inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_IF_NODEBUG + inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename enable_if < is_trivially_copy_assignable<_Tp>::value, diff --git a/libcxx/include/memory b/libcxx/include/memory --- a/libcxx/include/memory +++ b/libcxx/include/memory @@ -2246,8 +2246,9 @@ __compressed_pair_elem(_ParamT __p) : __value_(std::forward<_ParamT>(__p)) {} #endif - _LIBCPP_INLINE_VISIBILITY reference __get() _NOEXCEPT { return __value_; } - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + reference __get() _NOEXCEPT { return __value_; } + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference __get() const _NOEXCEPT { return __value_; } private: @@ -2285,8 +2286,9 @@ : __value_type(std::forward<_ParamT>(__p)) {} #endif - _LIBCPP_INLINE_VISIBILITY reference __get() _NOEXCEPT { return *this; } - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 + reference __get() _NOEXCEPT { return *this; } + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference __get() const _NOEXCEPT { return *this; } }; @@ -2361,27 +2363,27 @@ : _Base1(_VSTD::forward<_T1>(__t1)), _Base2(_VSTD::forward<_T2>(__t2)) {} #endif - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 typename _Base1::reference first() _NOEXCEPT { return static_cast<_Base1&>(*this).__get(); } - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 typename _Base1::const_reference first() const _NOEXCEPT { return static_cast<_Base1 const&>(*this).__get(); } - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 typename _Base2::reference second() _NOEXCEPT { return static_cast<_Base2&>(*this).__get(); } - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 typename _Base2::const_reference second() const _NOEXCEPT { return static_cast<_Base2 const&>(*this).__get(); } - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 void swap(__compressed_pair& __x) _NOEXCEPT_(__is_nothrow_swappable<_T1>::value && __is_nothrow_swappable<_T2>::value) @@ -2393,7 +2395,7 @@ }; template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 void swap(__compressed_pair<_T1, _T2>& __x, __compressed_pair<_T1, _T2>& __y) _NOEXCEPT_(__is_nothrow_swappable<_T1>::value && __is_nothrow_swappable<_T2>::value) { @@ -5361,7 +5363,7 @@ // --- Helper for container swap -- template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 void __swap_allocator(_Alloc & __a1, _Alloc & __a2) #if _LIBCPP_STD_VER >= 14 _NOEXCEPT @@ -5374,7 +5376,7 @@ } template -_LIBCPP_INLINE_VISIBILITY +_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 void __swap_allocator(_Alloc & __a1, _Alloc & __a2, true_type) #if _LIBCPP_STD_VER >= 14 _NOEXCEPT @@ -5387,7 +5389,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 void __swap_allocator(_Alloc &, _Alloc &, false_type) _NOEXCEPT {} template > diff --git a/libcxx/include/vector b/libcxx/include/vector --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -300,7 +300,7 @@ class _LIBCPP_TEMPLATE_VIS __vector_base_common { protected: - _LIBCPP_INLINE_VISIBILITY __vector_base_common() {} + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY __vector_base_common() {} _LIBCPP_NORETURN void __throw_length_error() const; _LIBCPP_NORETURN void __throw_out_of_range() const; }; @@ -343,43 +343,43 @@ pointer __end_; __compressed_pair __end_cap_; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY allocator_type& __alloc() _NOEXCEPT {return __end_cap_.second();} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const allocator_type& __alloc() const _NOEXCEPT {return __end_cap_.second();} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY pointer& __end_cap() _NOEXCEPT {return __end_cap_.first();} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const pointer& __end_cap() const _NOEXCEPT {return __end_cap_.first();} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY __vector_base() _NOEXCEPT_(is_nothrow_default_constructible::value); - _LIBCPP_INLINE_VISIBILITY __vector_base(const allocator_type& __a); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY __vector_base(const allocator_type& __a); #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY __vector_base(allocator_type&& __a) _NOEXCEPT; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY __vector_base(allocator_type&& __a) _NOEXCEPT; #endif - ~__vector_base(); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC ~__vector_base(); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void clear() _NOEXCEPT {__destruct_at_end(__begin_);} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY size_type capacity() const _NOEXCEPT {return static_cast(__end_cap() - __begin_);} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __destruct_at_end(pointer __new_last) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __copy_assign_alloc(const __vector_base& __c) {__copy_assign_alloc(__c, integral_constant());} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __move_assign_alloc(__vector_base& __c) _NOEXCEPT_( !__alloc_traits::propagate_on_container_move_assignment::value || @@ -387,7 +387,7 @@ {__move_assign_alloc(__c, integral_constant());} private: - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __copy_assign_alloc(const __vector_base& __c, true_type) { if (__alloc() != __c.__alloc()) @@ -399,25 +399,25 @@ __alloc() = __c.__alloc(); } - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __copy_assign_alloc(const __vector_base&, false_type) {} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __move_assign_alloc(__vector_base& __c, true_type) _NOEXCEPT_(is_nothrow_move_assignable::value) { __alloc() = _VSTD::move(__c.__alloc()); } - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __move_assign_alloc(__vector_base&, false_type) _NOEXCEPT {} }; template -inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY void __vector_base<_Tp, _Allocator>::__destruct_at_end(pointer __new_last) _NOEXCEPT { @@ -428,7 +428,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY __vector_base<_Tp, _Allocator>::__vector_base() _NOEXCEPT_(is_nothrow_default_constructible::value) : __begin_(nullptr), @@ -438,7 +438,7 @@ } template -inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY __vector_base<_Tp, _Allocator>::__vector_base(const allocator_type& __a) : __begin_(nullptr), __end_(nullptr), @@ -448,7 +448,7 @@ #ifndef _LIBCPP_CXX03_LANG template -inline _LIBCPP_INLINE_VISIBILITY +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY __vector_base<_Tp, _Allocator>::__vector_base(allocator_type&& __a) _NOEXCEPT : __begin_(nullptr), __end_(nullptr), @@ -456,7 +456,7 @@ #endif template -__vector_base<_Tp, _Allocator>::~__vector_base() +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC __vector_base<_Tp, _Allocator>::~__vector_base() { if (__begin_ != nullptr) { @@ -491,14 +491,14 @@ static_assert((is_same::value), "Allocator::value_type must be same type as value_type"); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY vector() _NOEXCEPT_(is_nothrow_default_constructible::value) { #if _LIBCPP_DEBUG_LEVEL >= 2 __get_db()->__insert_c(this); #endif } - _LIBCPP_INLINE_VISIBILITY explicit vector(const allocator_type& __a) + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY explicit vector(const allocator_type& __a) #if _LIBCPP_STD_VER <= 14 _NOEXCEPT_(is_nothrow_copy_constructible::value) #else @@ -510,13 +510,14 @@ __get_db()->__insert_c(this); #endif } - explicit vector(size_type __n); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC explicit vector(size_type __n); #if _LIBCPP_STD_VER > 11 - explicit vector(size_type __n, const allocator_type& __a); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC explicit vector(size_type __n, const allocator_type& __a); #endif - vector(size_type __n, const value_type& __x); - vector(size_type __n, const value_type& __x, const allocator_type& __a); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector(size_type __n, const value_type& __x); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector(size_type __n, const value_type& __x, const allocator_type& __a); template + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector(_InputIterator __first, typename enable_if<__is_input_iterator <_InputIterator>::value && !__is_forward_iterator<_InputIterator>::value && @@ -525,6 +526,7 @@ typename iterator_traits<_InputIterator>::reference>::value, _InputIterator>::type __last); template + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a, typename enable_if<__is_input_iterator <_InputIterator>::value && !__is_forward_iterator<_InputIterator>::value && @@ -532,6 +534,7 @@ value_type, typename iterator_traits<_InputIterator>::reference>::value>::type* = 0); template + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector(_ForwardIterator __first, typename enable_if<__is_forward_iterator<_ForwardIterator>::value && is_constructible< @@ -539,13 +542,14 @@ typename iterator_traits<_ForwardIterator>::reference>::value, _ForwardIterator>::type __last); template + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a, typename enable_if<__is_forward_iterator<_ForwardIterator>::value && is_constructible< value_type, typename iterator_traits<_ForwardIterator>::reference>::value>::type* = 0); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY ~vector() { __annotate_delete(); @@ -554,19 +558,19 @@ #endif } - vector(const vector& __x); - vector(const vector& __x, const allocator_type& __a); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector(const vector& __x); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector(const vector& __x, const allocator_type& __a); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY vector& operator=(const vector& __x); #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY vector(initializer_list __il); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY vector(initializer_list __il, const allocator_type& __a); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY vector(vector&& __x) #if _LIBCPP_STD_VER > 14 _NOEXCEPT; @@ -574,19 +578,20 @@ _NOEXCEPT_(is_nothrow_move_constructible::value); #endif - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY vector(vector&& __x, const allocator_type& __a); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY vector& operator=(vector&& __x) _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value)); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY vector& operator=(initializer_list __il) {assign(__il.begin(), __il.end()); return *this;} #endif // !_LIBCPP_CXX03_LANG template + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename enable_if < __is_input_iterator <_InputIterator>::value && @@ -598,6 +603,7 @@ >::type assign(_InputIterator __first, _InputIterator __last); template + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename enable_if < __is_forward_iterator<_ForwardIterator>::value && @@ -608,113 +614,113 @@ >::type assign(_ForwardIterator __first, _ForwardIterator __last); - void assign(size_type __n, const_reference __u); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void assign(size_type __n, const_reference __u); #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void assign(initializer_list __il) {assign(__il.begin(), __il.end());} #endif - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const _NOEXCEPT {return this->__alloc();} - _LIBCPP_INLINE_VISIBILITY iterator begin() _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY iterator end() _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY const_iterator end() const _NOEXCEPT; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY iterator begin() _NOEXCEPT; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY iterator end() _NOEXCEPT; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const_iterator end() const _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const_reverse_iterator rbegin() const _NOEXCEPT {return const_reverse_iterator(end());} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY reverse_iterator rend() _NOEXCEPT {return reverse_iterator(begin());} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const_reverse_iterator rend() const _NOEXCEPT {return const_reverse_iterator(begin());} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const_iterator cbegin() const _NOEXCEPT {return begin();} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const_iterator cend() const _NOEXCEPT {return end();} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const_reverse_iterator crend() const _NOEXCEPT {return rend();} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY size_type size() const _NOEXCEPT {return static_cast(this->__end_ - this->__begin_);} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY size_type capacity() const _NOEXCEPT {return __base::capacity();} - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY + _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY bool empty() const _NOEXCEPT {return this->__begin_ == this->__end_;} - size_type max_size() const _NOEXCEPT; - void reserve(size_type __n); - void shrink_to_fit() _NOEXCEPT; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC size_type max_size() const _NOEXCEPT; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void reserve(size_type __n); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void shrink_to_fit() _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __n) const _NOEXCEPT; - reference at(size_type __n); - const_reference at(size_type __n) const; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n) _NOEXCEPT; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __n) const _NOEXCEPT; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC reference at(size_type __n); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC const_reference at(size_type __n) const; - _LIBCPP_INLINE_VISIBILITY reference front() _NOEXCEPT + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY reference front() _NOEXCEPT { _LIBCPP_ASSERT(!empty(), "front() called for empty vector"); return *this->__begin_; } - _LIBCPP_INLINE_VISIBILITY const_reference front() const _NOEXCEPT + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const_reference front() const _NOEXCEPT { _LIBCPP_ASSERT(!empty(), "front() called for empty vector"); return *this->__begin_; } - _LIBCPP_INLINE_VISIBILITY reference back() _NOEXCEPT + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY reference back() _NOEXCEPT { _LIBCPP_ASSERT(!empty(), "back() called for empty vector"); return *(this->__end_ - 1); } - _LIBCPP_INLINE_VISIBILITY const_reference back() const _NOEXCEPT + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const_reference back() const _NOEXCEPT { _LIBCPP_ASSERT(!empty(), "back() called for empty vector"); return *(this->__end_ - 1); } - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY value_type* data() _NOEXCEPT {return _VSTD::__to_raw_pointer(this->__begin_);} - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const value_type* data() const _NOEXCEPT {return _VSTD::__to_raw_pointer(this->__begin_);} #ifdef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __emplace_back(const value_type& __x) { push_back(__x); } #else template - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __emplace_back(_Arg&& __arg) { emplace_back(_VSTD::forward<_Arg>(__arg)); } #endif - _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x); #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY void push_back(value_type&& __x); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void push_back(value_type&& __x); template - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY #if _LIBCPP_STD_VER > 14 reference emplace_back(_Args&&... __args); #else @@ -722,19 +728,20 @@ #endif #endif // !_LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void pop_back(); - iterator insert(const_iterator __position, const_reference __x); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC iterator insert(const_iterator __position, const_reference __x); #ifndef _LIBCPP_CXX03_LANG - iterator insert(const_iterator __position, value_type&& __x); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC iterator insert(const_iterator __position, value_type&& __x); template - iterator emplace(const_iterator __position, _Args&&... __args); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC iterator emplace(const_iterator __position, _Args&&... __args); #endif // !_LIBCPP_CXX03_LANG - iterator insert(const_iterator __position, size_type __n, const_reference __x); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC iterator insert(const_iterator __position, size_type __n, const_reference __x); template + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename enable_if < __is_input_iterator <_InputIterator>::value && @@ -746,6 +753,7 @@ >::type insert(const_iterator __position, _InputIterator __first, _InputIterator __last); template + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename enable_if < __is_forward_iterator<_ForwardIterator>::value && @@ -757,15 +765,15 @@ insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last); #ifndef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY iterator insert(const_iterator __position, initializer_list __il) {return insert(__position, __il.begin(), __il.end());} #endif - _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position); - iterator erase(const_iterator __first, const_iterator __last); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC iterator erase(const_iterator __first, const_iterator __last); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void clear() _NOEXCEPT { size_type __old_size = size(); @@ -774,10 +782,10 @@ __invalidate_all_iterators(); } - void resize(size_type __sz); - void resize(size_type __sz, const_reference __x); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void resize(size_type __sz); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void resize(size_type __sz, const_reference __x); - void swap(vector&) + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void swap(vector&) #if _LIBCPP_STD_VER >= 14 _NOEXCEPT; #else @@ -785,47 +793,48 @@ __is_nothrow_swappable::value); #endif - bool __invariants() const; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC bool __invariants() const; #if _LIBCPP_DEBUG_LEVEL >= 2 - bool __dereferenceable(const const_iterator* __i) const; - bool __decrementable(const const_iterator* __i) const; - bool __addable(const const_iterator* __i, ptrdiff_t __n) const; - bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC bool __dereferenceable(const const_iterator* __i) const; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC bool __decrementable(const const_iterator* __i) const; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC bool __addable(const const_iterator* __i, ptrdiff_t __n) const; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const; #endif // _LIBCPP_DEBUG_LEVEL >= 2 private: - _LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators(); - _LIBCPP_INLINE_VISIBILITY void __invalidate_iterators_past(pointer __new_last); - void __vallocate(size_type __n); - void __vdeallocate() _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const; - void __construct_at_end(size_type __n); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators(); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __invalidate_iterators_past(pointer __new_last); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __vallocate(size_type __n); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __vdeallocate() _NOEXCEPT; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const; + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __construct_at_end(size_type __n); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __construct_at_end(size_type __n, const_reference __x); template + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename enable_if < __is_forward_iterator<_ForwardIterator>::value, void >::type __construct_at_end(_ForwardIterator __first, _ForwardIterator __last, size_type __n); - void __append(size_type __n); - void __append(size_type __n, const_reference __x); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __append(size_type __n); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __append(size_type __n, const_reference __x); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY iterator __make_iter(pointer __p) _NOEXCEPT; - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(const_pointer __p) const _NOEXCEPT; - void __swap_out_circular_buffer(__split_buffer& __v); - pointer __swap_out_circular_buffer(__split_buffer& __v, pointer __p); - void __move_range(pointer __from_s, pointer __from_e, pointer __to); - void __move_assign(vector& __c, true_type) + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __swap_out_circular_buffer(__split_buffer& __v); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC pointer __swap_out_circular_buffer(__split_buffer& __v, pointer __p); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __move_range(pointer __from_s, pointer __from_e, pointer __to); + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __move_assign(vector& __c, true_type) _NOEXCEPT_(is_nothrow_move_assignable::value); - void __move_assign(vector& __c, false_type) + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __move_assign(vector& __c, false_type) _NOEXCEPT_(__alloc_traits::is_always_equal::value); - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __destruct_at_end(pointer __new_last) _NOEXCEPT { __invalidate_iterators_past(__new_last); @@ -836,15 +845,15 @@ #ifndef _LIBCPP_CXX03_LANG template - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY inline void __push_back_slow_path(_Up&& __x); template - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY inline void __emplace_back_slow_path(_Args&&... __args); #else template - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY inline void __push_back_slow_path(_Up& __x); #endif @@ -853,6 +862,7 @@ // may not meet the AddressSanitizer alignment constraints. // See the documentation for __sanitizer_annotate_contiguous_container for more details. #ifndef _LIBCPP_HAS_NO_ASAN + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void __annotate_contiguous_container(const void *__beg, const void *__end, const void *__old_mid, const void *__new_mid) const @@ -862,30 +872,30 @@ __sanitizer_annotate_contiguous_container(__beg, __end, __old_mid, __new_mid); } #else - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __annotate_contiguous_container(const void*, const void*, const void*, const void*) const _NOEXCEPT {} #endif - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __annotate_new(size_type __current_size) const _NOEXCEPT { __annotate_contiguous_container(data(), data() + capacity(), data() + capacity(), data() + __current_size); } - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __annotate_delete() const _NOEXCEPT { __annotate_contiguous_container(data(), data() + capacity(), data() + size(), data() + capacity()); } - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __annotate_increase(size_type __n) const _NOEXCEPT { __annotate_contiguous_container(data(), data() + capacity(), data() + size(), data() + size() + __n); } - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __annotate_shrink(size_type __old_size) const _NOEXCEPT { __annotate_contiguous_container(data(), data() + capacity(), @@ -893,13 +903,13 @@ } struct _ConstructTransaction { - explicit _ConstructTransaction(vector &__v, size_type __n) + explicit _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _ConstructTransaction(vector &__v, size_type __n) : __v_(__v), __pos_(__v.__end_), __new_end_(__v.__end_ + __n) { #ifndef _LIBCPP_HAS_NO_ASAN __v_.__annotate_increase(__n); #endif } - ~_ConstructTransaction() { + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC ~_ConstructTransaction() { __v_.__end_ = __pos_; #ifndef _LIBCPP_HAS_NO_ASAN if (__pos_ != __new_end_) { @@ -918,7 +928,7 @@ }; template - _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR_DYNAMIC_ALLOC _LIBCPP_INLINE_VISIBILITY void __construct_one_at_end(_Args&& ...__args) { _ConstructTransaction __tx(*this, 1); __alloc_traits::construct(this->__alloc(), _VSTD::__to_raw_pointer(__tx.__pos_), @@ -944,6 +954,7 @@ #endif template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer& __v) { @@ -960,6 +971,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename vector<_Tp, _Allocator>::pointer vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer& __v, pointer __p) { @@ -986,6 +998,7 @@ // Postcondition: capacity() == __n // Postcondition: size() == 0 template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void vector<_Tp, _Allocator>::__vallocate(size_type __n) { @@ -997,6 +1010,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void vector<_Tp, _Allocator>::__vdeallocate() _NOEXCEPT { @@ -1009,6 +1023,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename vector<_Tp, _Allocator>::size_type vector<_Tp, _Allocator>::max_size() const _NOEXCEPT { @@ -1018,6 +1033,7 @@ // Precondition: __new_size > capacity() template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY typename vector<_Tp, _Allocator>::size_type vector<_Tp, _Allocator>::__recommend(size_type __new_size) const @@ -1037,6 +1053,7 @@ // Precondition: size() + __n <= capacity() // Postcondition: size() == size() + __n template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void vector<_Tp, _Allocator>::__construct_at_end(size_type __n) { @@ -1053,6 +1070,7 @@ // Postcondition: size() == old size() + __n // Postcondition: [i] == __x for all i in [size() - __n, __n) template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline void vector<_Tp, _Allocator>::__construct_at_end(size_type __n, const_reference __x) @@ -1065,6 +1083,7 @@ template template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename enable_if < __is_forward_iterator<_ForwardIterator>::value, @@ -1081,6 +1100,7 @@ // Postcondition: size() == size() + __n // Exception safety: strong. template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void vector<_Tp, _Allocator>::__append(size_type __n) { @@ -1100,6 +1120,7 @@ // Postcondition: size() == size() + __n // Exception safety: strong. template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void vector<_Tp, _Allocator>::__append(size_type __n, const_reference __x) { @@ -1115,6 +1136,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector<_Tp, _Allocator>::vector(size_type __n) { #if _LIBCPP_DEBUG_LEVEL >= 2 @@ -1129,6 +1151,7 @@ #if _LIBCPP_STD_VER > 11 template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector<_Tp, _Allocator>::vector(size_type __n, const allocator_type& __a) : __base(__a) { @@ -1144,6 +1167,7 @@ #endif template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x) { #if _LIBCPP_DEBUG_LEVEL >= 2 @@ -1157,6 +1181,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector<_Tp, _Allocator>::vector(size_type __n, const value_type& __x, const allocator_type& __a) : __base(__a) { @@ -1172,6 +1197,7 @@ template template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector<_Tp, _Allocator>::vector(_InputIterator __first, typename enable_if<__is_input_iterator <_InputIterator>::value && !__is_forward_iterator<_InputIterator>::value && @@ -1189,6 +1215,7 @@ template template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector<_Tp, _Allocator>::vector(_InputIterator __first, _InputIterator __last, const allocator_type& __a, typename enable_if<__is_input_iterator <_InputIterator>::value && !__is_forward_iterator<_InputIterator>::value && @@ -1206,6 +1233,7 @@ template template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector<_Tp, _Allocator>::vector(_ForwardIterator __first, typename enable_if<__is_forward_iterator<_ForwardIterator>::value && is_constructible< @@ -1226,6 +1254,7 @@ template template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector<_Tp, _Allocator>::vector(_ForwardIterator __first, _ForwardIterator __last, const allocator_type& __a, typename enable_if<__is_forward_iterator<_ForwardIterator>::value && is_constructible< @@ -1245,6 +1274,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector<_Tp, _Allocator>::vector(const vector& __x) : __base(__alloc_traits::select_on_container_copy_construction(__x.__alloc())) { @@ -1260,6 +1290,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC vector<_Tp, _Allocator>::vector(const vector& __x, const allocator_type& __a) : __base(__a) { @@ -1277,6 +1308,7 @@ #ifndef _LIBCPP_CXX03_LANG template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY vector<_Tp, _Allocator>::vector(vector&& __x) #if _LIBCPP_STD_VER > 14 @@ -1297,6 +1329,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY vector<_Tp, _Allocator>::vector(vector&& __x, const allocator_type& __a) : __base(__a) @@ -1322,6 +1355,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY vector<_Tp, _Allocator>::vector(initializer_list __il) { @@ -1336,6 +1370,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY vector<_Tp, _Allocator>::vector(initializer_list __il, const allocator_type& __a) : __base(__a) @@ -1351,6 +1386,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY vector<_Tp, _Allocator>& vector<_Tp, _Allocator>::operator=(vector&& __x) @@ -1362,6 +1398,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void vector<_Tp, _Allocator>::__move_assign(vector& __c, false_type) _NOEXCEPT_(__alloc_traits::is_always_equal::value) @@ -1376,6 +1413,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void vector<_Tp, _Allocator>::__move_assign(vector& __c, true_type) _NOEXCEPT_(is_nothrow_move_assignable::value) @@ -1394,6 +1432,7 @@ #endif // !_LIBCPP_CXX03_LANG template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY vector<_Tp, _Allocator>& vector<_Tp, _Allocator>::operator=(const vector& __x) @@ -1408,6 +1447,7 @@ template template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename enable_if < __is_input_iterator <_InputIterator>::value && @@ -1426,6 +1466,7 @@ template template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename enable_if < __is_forward_iterator<_ForwardIterator>::value && @@ -1463,6 +1504,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void vector<_Tp, _Allocator>::assign(size_type __n, const_reference __u) { @@ -1485,6 +1527,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::__make_iter(pointer __p) _NOEXCEPT @@ -1497,6 +1540,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY typename vector<_Tp, _Allocator>::const_iterator vector<_Tp, _Allocator>::__make_iter(const_pointer __p) const _NOEXCEPT @@ -1509,6 +1553,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::begin() _NOEXCEPT @@ -1517,6 +1562,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY typename vector<_Tp, _Allocator>::const_iterator vector<_Tp, _Allocator>::begin() const _NOEXCEPT @@ -1525,6 +1571,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::end() _NOEXCEPT @@ -1533,6 +1580,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY typename vector<_Tp, _Allocator>::const_iterator vector<_Tp, _Allocator>::end() const _NOEXCEPT @@ -1541,6 +1589,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY typename vector<_Tp, _Allocator>::reference vector<_Tp, _Allocator>::operator[](size_type __n) _NOEXCEPT @@ -1550,6 +1599,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY typename vector<_Tp, _Allocator>::const_reference vector<_Tp, _Allocator>::operator[](size_type __n) const _NOEXCEPT @@ -1559,6 +1609,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename vector<_Tp, _Allocator>::reference vector<_Tp, _Allocator>::at(size_type __n) { @@ -1568,6 +1619,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename vector<_Tp, _Allocator>::const_reference vector<_Tp, _Allocator>::at(size_type __n) const { @@ -1577,6 +1629,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void vector<_Tp, _Allocator>::reserve(size_type __n) { @@ -1589,6 +1642,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void vector<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT { @@ -1612,6 +1666,7 @@ template template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void #ifndef _LIBCPP_CXX03_LANG vector<_Tp, _Allocator>::__push_back_slow_path(_Up&& __x) @@ -1628,6 +1683,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY void vector<_Tp, _Allocator>::push_back(const_reference __x) @@ -1643,6 +1699,7 @@ #ifndef _LIBCPP_CXX03_LANG template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY void vector<_Tp, _Allocator>::push_back(value_type&& __x) @@ -1657,6 +1714,7 @@ template template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void vector<_Tp, _Allocator>::__emplace_back_slow_path(_Args&&... __args) { @@ -1670,6 +1728,7 @@ template template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline #if _LIBCPP_STD_VER > 14 typename vector<_Tp, _Allocator>::reference @@ -1692,6 +1751,7 @@ #endif // !_LIBCPP_CXX03_LANG template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline void vector<_Tp, _Allocator>::pop_back() @@ -1701,6 +1761,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::erase(const_iterator __position) @@ -1721,6 +1782,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::erase(const_iterator __first, const_iterator __last) { @@ -1743,6 +1805,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void vector<_Tp, _Allocator>::__move_range(pointer __from_s, pointer __from_e, pointer __to) { @@ -1761,6 +1824,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::insert(const_iterator __position, const_reference __x) { @@ -1798,6 +1862,7 @@ #ifndef _LIBCPP_CXX03_LANG template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x) { @@ -1831,6 +1896,7 @@ template template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args) { @@ -1866,6 +1932,7 @@ #endif // !_LIBCPP_CXX03_LANG template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename vector<_Tp, _Allocator>::iterator vector<_Tp, _Allocator>::insert(const_iterator __position, size_type __n, const_reference __x) { @@ -1909,6 +1976,7 @@ template template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename enable_if < __is_input_iterator <_InputIterator>::value && @@ -1963,6 +2031,7 @@ template template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC typename enable_if < __is_forward_iterator<_ForwardIterator>::value && @@ -2014,6 +2083,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void vector<_Tp, _Allocator>::resize(size_type __sz) { @@ -2025,6 +2095,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void vector<_Tp, _Allocator>::resize(size_type __sz, const_reference __x) { @@ -2036,6 +2107,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC void vector<_Tp, _Allocator>::swap(vector& __x) #if _LIBCPP_STD_VER >= 14 @@ -2060,6 +2132,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC bool vector<_Tp, _Allocator>::__invariants() const { @@ -2083,6 +2156,7 @@ #if _LIBCPP_DEBUG_LEVEL >= 2 template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC bool vector<_Tp, _Allocator>::__dereferenceable(const const_iterator* __i) const { @@ -2090,6 +2164,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC bool vector<_Tp, _Allocator>::__decrementable(const const_iterator* __i) const { @@ -2097,6 +2172,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC bool vector<_Tp, _Allocator>::__addable(const const_iterator* __i, ptrdiff_t __n) const { @@ -2105,6 +2181,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC bool vector<_Tp, _Allocator>::__subscriptable(const const_iterator* __i, ptrdiff_t __n) const { @@ -2115,6 +2192,7 @@ #endif // _LIBCPP_DEBUG_LEVEL >= 2 template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY void vector<_Tp, _Allocator>::__invalidate_all_iterators() @@ -2126,6 +2204,7 @@ template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY void vector<_Tp, _Allocator>::__invalidate_iterators_past(pointer __new_last) { @@ -3330,6 +3409,7 @@ }; template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY bool operator==(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y) @@ -3339,6 +3419,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY bool operator!=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y) @@ -3347,6 +3428,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY bool operator< (const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y) @@ -3355,6 +3437,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY bool operator> (const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y) @@ -3363,6 +3446,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY bool operator>=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y) @@ -3371,6 +3455,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY bool operator<=(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y) @@ -3379,6 +3464,7 @@ } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY void swap(vector<_Tp, _Allocator>& __x, vector<_Tp, _Allocator>& __y) @@ -3389,11 +3475,13 @@ #if _LIBCPP_STD_VER > 17 template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY void erase(vector<_Tp, _Allocator>& __c, const _Up& __v) { __c.erase(_VSTD::remove(__c.begin(), __c.end(), __v), __c.end()); } template +_LIBCPP_CONSTEXPR_DYNAMIC_ALLOC inline _LIBCPP_INLINE_VISIBILITY void erase_if(vector<_Tp, _Allocator>& __c, _Predicate __pred) { __c.erase(_VSTD::remove_if(__c.begin(), __c.end(), __pred), __c.end()); }