Today, we found that some STL: map code runs well in windows, but it cannot be compiled in Linux: "no match for 'operator = 'in' iter = ".
It is actually a simple line of code:
Iter = map. Erase (ITER)
The description of MAP: erase on msdn is as follows:
Iterator erase (iterator it );
Iterator erase (iterator first, iteratorlast );
Size_type erase (const key & Key );
After reading for a long time, I did not find any errors. I went to the Standard C/C ++ document and found the differences:
Void erase (iteratorpos );
Void erase (iteratorstart, iteratorend );
Size_type erase (const key_type & Key );
So I changed the code to this, which is available on both platforms:
Map. Erase (ITER ++)
I wonder why Windows does not use standard STL, So I compared the msdn and C ++ quasi-template libraries and found that the list and vector erase methods both return iterator,
For other containers, the standard library's erase method is in the above format.