QSet::erase - extend docs

Explicitly specify that calling this method for an empty set or with
an invalid iterator results in undefined behavior.

On a debug build an assert is triggered in such case, but on a release
build it will access the incorect index of an array.

Task-number: QTBUG-91736
Pick-to: 6.2 6.1
Change-Id: Ibc3e91512a0ad9d9779a41083fedb8a91780380b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Ivan Solovev 2021-07-08 15:32:28 +02:00
parent 7b1b1d990b
commit e5ec09ba86

View File

@ -275,6 +275,11 @@
internal data structure. This means that it can safely be called
while iterating, and won't affect the order of items in the set.
\note The iterator \a pos \e must be valid and dereferenceable. Calling this
method on any other iterator, including its own \l end(), results in
undefined behavior. In particular, even the \l begin() iterator of an empty
set cannot be dereferenced.
\sa remove(), find()
*/