[libcxx-commits] [PATCH] D61761: P1144 "Trivially relocatable" (1/3): is_trivially_relocatable, relocate_at, and uninitialized_relocate

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 10 14:32:18 PDT 2019


zoecarver added inline comments.


================
Comment at: include/memory:3463
+inline _LIBCPP_INLINE_VISIBILITY
+_Tp *__relocate_at_impl(_Tp *__source, _Tp *__dest, _IsMemcpyable) {
+    ::new (static_cast<void*>(__dest)) _Tp(_VSTD::move(*__dest));
----------------
Nit: is `_IsMemcpyable`  guaranteed to be `true_type` or `false_type`? If so, maybe make it specifically `false_type`.


================
Comment at: include/memory:3510
+    for (; __first != __last; (void)++__result, ++__first) {
+        ::new (static_cast<void*>(_VSTD::addressof(*__result))) _Dt(_VSTD::move(*__first));
+        _VSTD::destroy_at(std::addressof(*__first));
----------------
I think this should require `_LIBCPP_STD_VER > 03`.


================
Comment at: include/memory:3556
+        integral_constant<bool,
+            !is_volatile<_St>::value && !is_volatile<_Dt>::value &&
+            __is_same_uncvref<_St, _Dt>::value &&
----------------
What is the reason for `is_volatile`? I don't see that in the paper (but maybe I am missing something).


================
Comment at: test/libcxx/type_traits/is_trivially_relocatable.pass.cpp:33
+#include <memory>
+//#include <memory_resource>
+#include <mutex>
----------------
Maybe add a test for things that are `experimental`?


================
Comment at: test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_relocatable.pass.cpp:14
+
+// UNSUPPORTED: c++03
+// XFAIL: gcc-4.9
----------------
Shouldn't this also contain `c++98`?


Repository:
  rCXX libc++

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61761/new/

https://reviews.llvm.org/D61761





More information about the libcxx-commits mailing list