diff options
-rw-r--r-- | src/corelib/tools/qvarlengtharray.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index 3668ebcfc9..18066a80ef 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -63,7 +63,10 @@ class QVarLengthArray static_assert(std::is_nothrow_destructible_v<T>, "Types with throwing destructors are not supported in Qt containers."); public: - QVarLengthArray() : QVarLengthArray(0) {} + QVarLengthArray() noexcept + : a{Prealloc}, s{0}, ptr{reinterpret_cast<T *>(array)} + { + } inline explicit QVarLengthArray(qsizetype size); |