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.9 6.8 6.5
Change-Id: Ie26f5eba586a3cd2d3e0cd769427f518e1bc92b9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
Kai Uwe Broulik 2025-05-12 09:25:47 +02:00
parent 0d61e8ec53
commit 427bd9a42c

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: