From dcd2735dca110501a46d5d909c65e18448c78481 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 7 Oct 2022 23:13:17 +0200 Subject: [PATCH] QPluginMetaData: replace manual loop with q20::copy_n Change-Id: I7061b18efd2ff905cc36df41d680c0612a505a76 Reviewed-by: Thiago Macieira (cherry picked from commit 9bd287335b2b7a70e116f4ef955e9e12df9009d0) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/plugin/qplugin.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/plugin/qplugin.h b/src/corelib/plugin/qplugin.h index 5ac3ed92414..017064e747a 100644 --- a/src/corelib/plugin/qplugin.h +++ b/src/corelib/plugin/qplugin.h @@ -9,6 +9,8 @@ #include #include +#include + QT_BEGIN_NAMESPACE // Used up to Qt 6.2 @@ -38,10 +40,8 @@ struct QPluginMetaData template static constexpr void copy(OO (&out)[OSize], II (&in)[ISize]) { - // std::copy is not constexpr until C++20 static_assert(OSize <= ISize, "Output would not be fully initialized"); - for (size_t i = 0; i < OSize; ++i) - out[i] = in[i]; + q20::copy_n(in, OSize, out); } static constexpr quint8 archRequirements()