[libc++] Make __swap_allocator constexpr

Make `__swap_allocator` constexpr

Reviewed By: Quuxplusone, ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D115719
This commit is contained in:
Nikolas Klauser 2021-12-14 12:59:11 +01:00
parent ac60263ad1
commit 10a356c47a
1 changed files with 5 additions and 5 deletions

View File

@ -832,9 +832,9 @@ _LIBCPP_FUNC_VIS void* align(size_t __align, size_t __sz, void*& __ptr, size_t&
// --- Helper for container swap --
template <typename _Alloc>
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
void __swap_allocator(_Alloc & __a1, _Alloc & __a2, true_type)
#if _LIBCPP_STD_VER >= 14
#if _LIBCPP_STD_VER > 11
_NOEXCEPT
#else
_NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)
@ -845,13 +845,13 @@ void __swap_allocator(_Alloc & __a1, _Alloc & __a2, true_type)
}
template <typename _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
void __swap_allocator(_Alloc &, _Alloc &, false_type) _NOEXCEPT {}
template <typename _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
void __swap_allocator(_Alloc & __a1, _Alloc & __a2)
#if _LIBCPP_STD_VER >= 14
#if _LIBCPP_STD_VER > 11
_NOEXCEPT
#else
_NOEXCEPT_(__is_nothrow_swappable<_Alloc>::value)