[PATCH] D10998: Refactor the POCXX allocator-handling into some common routines, and try them out in vector

Eric Fiselier eric at efcs.ca
Tue Jul 7 13:27:21 PDT 2015


This looks like a good first step to removing this duplication. It would be nice if all of the relevant changes were in before 3.7.

The direction of the patch LGTM but I would like to understand the need for the noexcept specifications on `__swap_allocator` before I approve it.


================
Comment at: include/memory:5551
@@ +5550,3 @@
+#if _LIBCPP_STD_VER >= 14
+    _NOEXCEPT
+#else
----------------
Do we need these `_NOEXCEPT` decorators at all? I don't see where they are used or visible to the user.

================
Comment at: include/memory:5556
@@ +5555,3 @@
+{
+    __swap_alloc(__a1, __a2, 
+                 _VSTD::allocator_traits<_Alloc>::propagate_on_container_swap());
----------------
Shouldn't this call be `__swap_allocator`?

================
Comment at: test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp:56
@@ -55,1 +55,3 @@
         C c1, c2;
+#if _LIBCPP_STD_VER >= 14
+    //  In c++14, if POCS is set, swapping the allocator is required not to throw
----------------
Use `TEST_STD_VER`.

================
Comment at: test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp:57
@@ -56,1 +56,3 @@
         C c1, c2;
+#if _LIBCPP_STD_VER >= 14
+    //  In c++14, if POCS is set, swapping the allocator is required not to throw
----------------
Use `TEST_STD_VER` instead.


http://reviews.llvm.org/D10998







More information about the cfe-commits mailing list