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

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 9 14:32:08 PDT 2019


Quuxplusone created this revision.
Quuxplusone added a reviewer: ldionne.
Herald added subscribers: libcxx-commits, jfb, dexonsmith, christof.

Implement "trivially relocatable" traits and algorithms.

This implements the library behavior proposed in P1144R3. This patch doesn't do any special optimizations (e.g. to `std::vector::reserve`) nor add warrants to libc++ class types; those will come later. This is just the bare minimum to conform to P1144 <https://reviews.llvm.org/P1144>'s additions to the standard.

We don't mangle `relocate_at` into `__relocate_at`, etc., although we could if we want to hide it from end-users.

We don't mangle `is_trivially_relocatable` into `__is_trivially_relocatable`, nor can we, because that's the name of the compiler builtin in my Clang patch. Same reason we can't mangle `is_trivially_constructible` into `__is_trivially_constructible`. If we want to hide `is_trivially_relocatable` from end-users, we should come up with a new convention, such as `__ext_is_trivially_relocatable`.

TODO:

- hide names? how?
- any reason to gate the new names on any particular `_LIBCPP_STD_VER`, such as 17? (I think not.)
- split up the tests for `uninitialized_relocate{,_n}` into three or four files each?
- write a test for `relocate_at`


Repository:
  rCXX libc++

https://reviews.llvm.org/D61761

Files:
  include/memory
  include/type_traits
  test/libcxx/type_traits/is_trivially_relocatable.pass.cpp
  test/std/utilities/memory/specialized.algorithms/uninitialized.relocate/uninitialized_relocate.pass.cpp
  test/std/utilities/memory/specialized.algorithms/uninitialized.relocate/uninitialized_relocate_n.pass.cpp
  test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_relocatable.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61761.198907.patch
Type: text/x-patch
Size: 37600 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190509/c712d991/attachment-0001.bin>


More information about the libcxx-commits mailing list