summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qflatmap_p.h
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2022-11-03 21:44:41 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2022-11-08 01:05:20 +0100
commit2ec77f4f11b5e01e25307a068cd3b360b37011e0 (patch)
treea578e0c3102047abfe5d90d6ecfc5f18673e4cfe /src/corelib/tools/qflatmap_p.h
parentffb44ad8ef29dd824da2ad375bab2c2d3a55e76a (diff)
QFlatMap: fix a declval usage
The comparator object is allowed to reject rvalues. Use a const lvalue ref. Change-Id: Id4ab5e094f3a0f4e6b2549ee5d3105d93faf1d14 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qflatmap_p.h')
-rw-r--r--src/corelib/tools/qflatmap_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qflatmap_p.h b/src/corelib/tools/qflatmap_p.h
index 28bb72c864..ba02503d2b 100644
--- a/src/corelib/tools/qflatmap_p.h
+++ b/src/corelib/tools/qflatmap_p.h
@@ -74,7 +74,7 @@ public:
using value_type = std::pair<const Key, T>;
static constexpr bool is_comparator_noexcept = noexcept(
- std::declval<Compare>()(std::declval<Key>(), std::declval<Key>()));
+ std::declval<Compare>()(std::declval<const Key &>(), std::declval<const Key &>()));
bool operator()(const value_type &lhs, const value_type &rhs) const
noexcept(is_comparator_noexcept)