diff --git a/dynarray.h b/dynarray.h index 192206ba..62d65f65 100644 --- a/dynarray.h +++ b/dynarray.h @@ -593,7 +593,7 @@ typename dynarray::iterator OEL_DYNARR_INSERT_STEP1 // Temporary in case constructor throws or args refer to an element of this dynarray - storage_for tmp; + alignas(T) unsigned char tmp[sizeof(T)]; _alloTrait::construct(_m, reinterpret_cast(&tmp), static_cast(args)...); if (_m.end < _m.reservEnd) { // Relocate [pos, end) to [pos + 1, end + 1)