This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by EricWF on Jul 11 2016, 6:53 PM.

Details

Reviewers
mclow.lists
Summary

Example Usage: To check the EmplaceConstructible Container requirement you would ask:

__is_alloc_constructible<allocator_type&, value_type, Args...>::value

Diff Detail

Event Timeline

EricWF updated this revision to Diff 63626.Jul 11 2016, 6:53 PM
EricWF retitled this revision from to [libcxx] Create __is_alloc_constructible<Alloc, Type, Args...> trait which checks the validity of allocator_traits construction..
EricWF updated this object.
EricWF added a reviewer: mclow.lists.
EricWF added a subscriber: cfe-commits.
EricWF updated this revision to Diff 63635.Jul 11 2016, 9:08 PM
  • 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.
EricWF updated this revision to Diff 63636.Jul 11 2016, 9:08 PM

Add correct tests.