qBound: Don't claim it's "equivalent to qMax(min, qMin(val, max))"

While technically true, those don't assert while qBound does,
so it gives you a false sense of security that
qBound(min, val, max) is safe for unsanitized input ranges.

Pick-to: 6.8 6.5
Change-Id: Ie26f5eba586a3cd2d3e0cd769427f518e1bc92b9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 427bd9a42c68f6cc7afd9b9c13036873916cbfa0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Kai Uwe Broulik 2025-05-12 09:25:47 +02:00 committed by Qt Cherry-pick Bot
parent 075b4d1eb6
commit f8e4bff0a6

View File

@ -28,8 +28,7 @@
/*! \fn template <typename T> const T &qBound(const T &min, const T &val, const T &max)
\relates <QtMinMax>
Returns \a val bounded by \a min and \a max. This is equivalent
to qMax(\a min, qMin(\a val, \a max)).
Returns \a val bounded by \a min and \a max.
Example: