Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Multiple iterators problems
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bugmenot
New Member

4 Posts

Posted - Jun 20 2014 :  10:30:32 AM  Show Profile  Reply with Quote
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

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Jun 27 2014 :  12:10:45 AM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description.

case=11502

As you will have realised, VA is getting confused with the same variable name being reused to mean something different inside the same function.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000