[PATCH] D22255: [libcxx] Create __is_alloc_constructible<Alloc, Type, Args...> trait which checks the validity of allocator_traits construction.

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 11 21:08:21 PDT 2016


EricWF updated this revision to Diff 63635.
EricWF added a comment.

- Don't use `is_constructible` in the `__is_alloc_constructible` implementation. `is_constructible<T, ...>` requires  `is_destructible<T>`, but that isn't required within allocators.  Instead this trait checks the validity of the placement new expression.

- Add tests for `__is_alloc_constructible`. Not complete but a good start.

- Implement sample changes to `<vector>` that fix PR28412 (https://llvm.org/bugs/show_bug.cgi?id=28412). See `tagging_allocator_instantation.pass.cpp` for the example test.


http://reviews.llvm.org/D22255

Files:
  include/memory
  include/type_traits
  include/vector
  test/libcxx/utilities/memory/allocator.traits/__is_alloc_constructible.pass.cpp
  test/libcxx/utilities/memory/allocator.traits/vector_instant.pass.cpp
  test/support/tagging_allocator.hpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22255.63635.patch
Type: text/x-patch
Size: 24811 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160712/2c25dfed/attachment-0001.bin>


More information about the cfe-commits mailing list