summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qalgorithms
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-08-12 14:14:02 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-08-14 15:52:58 +0200
commit6f0df02d002356625f10683ef84da7685d92a2c4 (patch)
tree46713209af459ebda534c3404f48c5f5c80ba3f8 /tests/auto/corelib/tools/qalgorithms
parent44cce1a2ea9dadd8b2de93f40de34269dda703c0 (diff)
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 <sona.kurazyan@qt.io>
Diffstat (limited to 'tests/auto/corelib/tools/qalgorithms')
-rw-r--r--tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp10
1 files changed, 5 insertions, 5 deletions
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);
}