For fallowing code:
#include <vector>
struct A
{
int a, b;
};
struct B
{
int c, d;
};
using namespace std;
int main()
{
vector<A> v1;
vector<B> v2;
for(vector<A>::iterator it = v1.begin(), end = v1.end(); it != end; ++it)
{
it->a = 0;
it->b = 0;
it->c = 0;
it->d = 0;
}
for(vector<B>::iterator it = v2.begin(), end = v2.end(); it != end; ++it)
{
it->a = 0;
it->b = 0;
it->c = 0;
it->d = 0;
}
return 0;
}
Writing "it->" in first loop will show sometimes that object pointed by iterator have four variables a, b, c and d; sometimes it shows that it have only c and d, and underline "it->a = 3;" as error.
Writing this in second loop will correctly show only c and d.
See screenshot and look at underline.
License: trial
VA_X.dll file version 10.8.2036.0 built 2014.05.22
DevEnv.exe version 9.0.30729.1 Professional
msenv.dll version 9.0.30729.1
Font: Courier New 13 (pixels)
Comctl32.dll version 6.10.9200.16384
Windows 8 6.2 Build 9200
4 processors (x86-64, WOW64)
Language info: 1250, 0x415
Platform: Win32
Stable Includes:
c:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\include;
c:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\include;
C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include;
C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include;
C:\\Program Files (x86)\\Microsoft DirectX SDK (June 2010)\\Include;
C:\\Program Files (x86)\\Visual Leak Detector\\include;
Other Includes:
Stable Source Directories:
c:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\mfc;
c:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\mfcm;
c:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\atl;
c:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\crt\\src;
IDE: Visual Studio 2008