QVLA: use std::aligned_storage

Remove the hand-rolled union used only to achieve alignment.

Change-Id: I8e635fa0d09042f30fd67d589db9bc384c0ec8ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Giuseppe D'Angelo 2020-07-12 14:43:21 +02:00
parent 1ecc884bfd
commit 20848f6e83

View File

@ -293,11 +293,7 @@ private:
qsizetype a; // capacity
qsizetype s; // size
T *ptr; // data
union {
char array[Prealloc * sizeof(T)];
qint64 q_for_alignment_1;
double q_for_alignment_2;
};
std::aligned_storage_t<sizeof(T), alignof(T)> array[Prealloc];
bool isValidIterator(const const_iterator &i) const
{