[libcxx-commits] [libcxx] 10a356c - [libc++] Make __swap_allocator constexpr

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 14 06:42:59 PST 2021


Author: Nikolas Klauser
Date: 2021-12-14T15:41:56+01:00
New Revision: 10a356c47a30ee8544b3ecd5dc0adf3f634abe2c

URL: https://github.com/llvm/llvm-project/commit/10a356c47a30ee8544b3ecd5dc0adf3f634abe2c
DIFF: https://github.com/llvm/llvm-project/commit/10a356c47a30ee8544b3ecd5dc0adf3f634abe2c.diff

LOG: [libc++] Make __swap_allocator constexpr

Make `__swap_allocator` constexpr

Reviewed By: Quuxplusone, ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D115719

Added: 
    

Modified: 
    libcxx/include/memory

Removed: 
    


################################################################################
diff  --git a/libcxx/include/memory b/libcxx/include/memory
index 4d9dab55b0c3..bf2e96e0a81c 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -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)


        


More information about the libcxx-commits mailing list