From 6f0df02d002356625f10683ef84da7685d92a2c4 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 12 Aug 2020 14:14:02 +0200 Subject: Replace Qt CONSTEXPR defines with constexpr Both normal and relaxed constexpr are required by our new minimum of C++17. Change-Id: Ic028b88a2e7a6cb7d5925f3133b9d54859a81744 Reviewed-by: Sona Kurazyan --- tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/auto/corelib/tools/qalgorithms') diff --git a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp index 964c68c9e9..44e6bef6f0 100644 --- a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp +++ b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp @@ -1046,25 +1046,25 @@ void tst_QAlgorithms::binaryFindOnLargeContainer() const #endif // QT_DEPRECATED_SINCE(5, 2) // alternative implementation of qPopulationCount for comparison: -static Q_DECL_CONSTEXPR const uint bitsSetInNibble[] = { +static constexpr const uint bitsSetInNibble[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, }; static_assert(sizeof bitsSetInNibble / sizeof *bitsSetInNibble == 16); -static Q_DECL_CONSTEXPR uint bitsSetInByte(quint8 byte) +static constexpr uint bitsSetInByte(quint8 byte) { return bitsSetInNibble[byte & 0xF] + bitsSetInNibble[byte >> 4]; } -static Q_DECL_CONSTEXPR uint bitsSetInShort(quint16 word) +static constexpr uint bitsSetInShort(quint16 word) { return bitsSetInByte(word & 0xFF) + bitsSetInByte(word >> 8); } -static Q_DECL_CONSTEXPR uint bitsSetInInt(quint32 word) +static constexpr uint bitsSetInInt(quint32 word) { return bitsSetInShort(word & 0xFFFF) + bitsSetInShort(word >> 16); } -static Q_DECL_CONSTEXPR uint bitsSetInInt64(quint64 word) +static constexpr uint bitsSetInInt64(quint64 word) { return bitsSetInInt(word & 0xFFFFFFFF) + bitsSetInInt(word >> 32); } -- cgit v1.2.3