-
Type:
Bug
-
Status: Closed
-
Priority:
P4: Low
-
Resolution: Done
-
Affects Version/s: 5.0.1
-
Fix Version/s: 5.3.0
-
Component/s: Core: Containers and Algorithms
-
Labels:None
-
Environment:Windows 7 VS2010
-
Commits:1c63909ad8caee11ba0ec4af998d981bd50d3ee1
There is a compile error when building the code below.
#define QT_STRICT_ITERATORS #include <QVector> int main() { QVector<int> v; v.push_back(0); v.erase(v.begin()); return 0; }
This is the error:
d:\visualstudio2010\qtcommercial5.0.1_32bit\5.0.1\msvc2010\include\qtcore\qvector.h(617) : error C2839: invalid return type 'int *' for overloaded 'operator ->' d:\visualstudio2010\qtcommercial5.0.1_32bit\5.0.1\msvc2010\include\qtcore\qvector.h(594) : while compiling class template member function 'QTypedArrayData<T>::iterator QVector<T>::erase(QTypedArrayData<T>::iterator,QTypedArrayData<T>::iterator)' with [ T=int ] main.cpp(6) : see reference to class template instantiation 'QVector<T>' being compiled with [ T=int ] d:\visualstudio2010\qtcommercial5.0.1_32bit\5.0.1\msvc2010\include\qtcore\qvector.h(617) : error C2300: 'QTypedArrayData<T>::iterator' : class does not have a destructor called '~T' with [ T=int ]
The same code compiles correctly with Qt 4.8.4.