QVector: remove brittle c2m() function
The c2m() function converts a const_iterator into an iterator, but is a broken concept for an implicitly shared container such as QVector, because the act of calling begin() as the starting point already detaches and invalidates the c2m argument. This could be fixed in c2m, but it's too easy for a caller to cause iterator invalidation even before calling c2m, as QTBUG-44592 showed, so remove the function completely. Task-number: QTBUG-44592 Change-Id: Ibde8cd1d78a412cc9fb621f743e52f74291aff4f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
4300f6e9cc
commit
d2f418e98f
@ -265,7 +265,6 @@ private:
|
||||
{
|
||||
return (i <= d->end()) && (d->begin() <= i);
|
||||
}
|
||||
iterator c2m(const_iterator it) { return begin() + (it - cbegin()); }
|
||||
class AlignmentDummy { Data header; T array[1]; };
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user