diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index 2c9d0dd975..72f76dad18 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -260,6 +260,9 @@ class QVarLengthArray using Storage = QVLAStorage; static_assert(std::is_nothrow_destructible_v, "Types with throwing destructors are not supported in Qt containers."); using Base::verify; + + template + using if_copyable = std::enable_if_t, bool>; public: using size_type = typename Base::size_type; using value_type = typename Base::value_type; @@ -393,13 +396,10 @@ public: } bool isEmpty() const { return empty(); } void resize(qsizetype sz) { Base::resize_impl(Prealloc, this->array, sz); } -#ifdef Q_QDOC - void -#else - template - std::enable_if_t> +#ifndef Q_QDOC + template = true> #endif - resize(qsizetype sz, const T &v) + void resize(qsizetype sz, const T &v) { Base::resize_impl(Prealloc, this->array, sz, &v); } inline void clear() { resize(0); } void squeeze() { reallocate(size(), size()); }