Skip to content

Commit 171cd5a

Browse files
constexpr deque
1 parent cab738b commit 171cd5a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

libcxx/include/deque

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2543,7 +2543,8 @@ inline void deque<_Tp, _Allocator>::clear() _NOEXCEPT {
25432543
}
25442544

25452545
template <class _Tp, class _Allocator>
2546-
inline _LIBCPP_HIDE_FROM_ABI bool operator==(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y) {
2546+
inline _LIBCPP_HIDE_FROM_ABI constexpr bool
2547+
operator==(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y) {
25472548
const typename deque<_Tp, _Allocator>::size_type __sz = __x.size();
25482549
return __sz == __y.size() && std::equal(__x.begin(), __x.end(), __y.begin());
25492550
}
@@ -2578,30 +2579,30 @@ inline _LIBCPP_HIDE_FROM_ABI bool operator<=(const deque<_Tp, _Allocator>& __x,
25782579
# else // _LIBCPP_STD_VER <= 17
25792580

25802581
template <class _Tp, class _Allocator>
2581-
_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp>
2582+
_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp> constexpr
25822583
operator<=>(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y) {
25832584
return std::lexicographical_compare_three_way(__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way);
25842585
}
25852586

25862587
# endif // _LIBCPP_STD_VER <= 17
25872588

25882589
template <class _Tp, class _Allocator>
2589-
inline _LIBCPP_HIDE_FROM_ABI void swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocator>& __y)
2590+
inline _LIBCPP_HIDE_FROM_ABI constexpr void swap(deque<_Tp, _Allocator>& __x, deque<_Tp, _Allocator>& __y)
25902591
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) {
25912592
__x.swap(__y);
25922593
}
25932594

25942595
# if _LIBCPP_STD_VER >= 20
25952596
template <class _Tp, class _Allocator, class _Up>
2596-
inline _LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::size_type
2597+
inline _LIBCPP_HIDE_FROM_ABI constexpr typename deque<_Tp, _Allocator>::size_type
25972598
erase(deque<_Tp, _Allocator>& __c, const _Up& __v) {
25982599
auto __old_size = __c.size();
25992600
__c.erase(std::remove(__c.begin(), __c.end(), __v), __c.end());
26002601
return __old_size - __c.size();
26012602
}
26022603

26032604
template <class _Tp, class _Allocator, class _Predicate>
2604-
inline _LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::size_type
2605+
inline _LIBCPP_HIDE_FROM_ABI constexpr typename deque<_Tp, _Allocator>::size_type
26052606
erase_if(deque<_Tp, _Allocator>& __c, _Predicate __pred) {
26062607
auto __old_size = __c.size();
26072608
__c.erase(std::remove_if(__c.begin(), __c.end(), __pred), __c.end());

0 commit comments

Comments
 (0)