Resolve TODO in aligned_allocator
And updated corresponding test. AllocateAligned was designed to take POD types only.
I also removed TestAllocateAlignedObjectWithoutDestructor because objects with constructor/destructor are obviously illegal input.
btw, restriction here can be one is_trivial, perhaps?
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Will this be merged?
Thanks for following up. I see that our internal CI had failed and blocked the merge. Investigating..
Mind if we change the check to:
static_assert(std::is_trivially_copyable<T>::value,
"AllocateAligned: requires trivially copyable T");
static_assert(std::is_trivially_destructible<T>::value,
"AllocateAligned: requires trivially destructible T");
? We have internal users that trip over the standard layout and trivial requirements.
Mind if we change the check to:
static_assert(std::is_trivially_copyable<T>::value, "AllocateAligned: requires trivially copyable T"); static_assert(std::is_trivially_destructible<T>::value, "AllocateAligned: requires trivially destructible T");? We have internal users that trip over the standard layout and trivial requirements.
Sure. In fact is_trivial_xxx is better
Thanks for checking!
Merged with the proposed modification. Thanks again!