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
 iterator always considered wrong
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gencha
Junior Member

24 Posts

Posted - Jan 29 2009 :  12:31:35 PM  Show Profile  Reply with Quote
Whenever I have an iterator or const_iterator in my code I get it underlined red. As if it was an error.
Like in a piece of code like this:
for( std::vector<IController*>::const_iterator currentController = controller.begin(); currentController != controller.end(); ++currentController ) {


It compiles and runs just fine. So I have no idea what the problem is here.

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jan 29 2009 :  3:41:02 PM  Show Profile  Reply with Quote
const_iterator is NOT underlined for me. I'm using VAX 1715 and VS2008.
Which IDE and VAX do you use?

Do you have other underlines before this one in the same file? If yes, VAX parser MAY got confused before this line.
Go to Top of Page

gencha
Junior Member

24 Posts

Posted - Jan 29 2009 :  8:38:41 PM  Show Profile  Reply with Quote
My System Info is

VA_X.dll file version 10.5.1711.0 built 2008.12.11
Licensed to:
VA X: [email protected] (1-user license) Support ends 2010.01.23
DevEnv.exe version 9.0.30729.1
msenv.dll version 9.0.30729.1
Font: Courier New 13(Pixels)
Comctl32.dll version 6.0.2900.5512
Windows XP 5.1 Build 2600 Service Pack 3
2 processors

Platform: Win32
Stable Includes:
C:\\Program Files\\Microsoft DirectX SDK (November 2008)\\Include;
E:\\Projekte\\Boost;
C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\include;
C:\\Program Files\\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;

Other Includes:

Stable Source Directories:
C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\mfc;
C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\mfcm;
C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\atl;
C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\crt\\src;


There are no other underlines. But const_iterator and iterator are always underlined in all files.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jan 30 2009 :  7:57:15 PM  Show Profile  Reply with Quote
Strange: I've installed 1711, but still working for me. Can you please try to rebuild your symbol databases to see if this helps?

press
VA Options -> Performance -> Clear history, cache and temporary files

then

VA Options -> Performance -> Rebuild symbol databases

Edited by - accord on Jan 30 2009 7:59:19 PM
Go to Top of Page

gencha
Junior Member

24 Posts

Posted - Jan 30 2009 :  9:48:38 PM  Show Profile  Reply with Quote
I did that, then restarted. VAX parsed my sources and the const_iterator in the file that was still open was not underlined. So I removed a letter and added it back again and the red underline appeared.
And even after a successful compile it still won't go away.

I did find out what causes it though.
As an example let's look at this function:

void SceneNode::update( SceneGraph& sceneGraph ) {
  for( std::vector<IController*>::const_iterator currentController = controller.begin(); currentController != controller.end(); ++currentController ) {
    (*currentController)->updateSceneNode( *this, sceneGraph );
  }
}


const_iterator will be underlined red.
Yet if I change that to:

using namespace std;
void SceneNode::update( SceneGraph& sceneGraph ) {
  for( vector<IController*>::const_iterator currentController = controller.begin(); currentController != controller.end(); ++currentController ) {
    (*currentController)->updateSceneNode( *this, sceneGraph );
  }
}


The underline will disappear. const_iterator will also appear in the IntelliSense dialog which was not the case before.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Feb 01 2009 :  1:59:12 PM  Show Profile  Reply with Quote
const_inerator is still recognized here. First, I pasted your code:

void SceneNode::update( SceneGraph& sceneGraph ) {
for( std::vector<IController*>::const_iterator currentController = controller.begin(); currentController != controller.end(); ++currentController ) {
(*currentController)->updateSceneNode( *this, sceneGraph );
}
}

but const_iterator wasn't underlined. To make the test more like-like, I created some dummy definition, so my code becomed:

class SceneGraph {};
class IController
{
void updateSceneNode();
};

class SceneNode {
void update(SceneGraph& sceneGraph);
};

void SceneNode::update( SceneGraph& sceneGraph ) {
std::vector<IController*> controller;
for( std::vector<IController*>::const_iterator currentController = controller.begin(); currentController != controller.end(); ++currentController ) {
(*currentController)->updateSceneNode( *this, sceneGraph );
}
}

Now, nothing is underlined.

Can you please try to create a new default C++, Win32 project and paste the source there, just to see if this helps?

>So I removed a letter and added it back again and the red underline appeared.
Yes, unrecognized symbols gets underlined after you modify the file.
Go to Top of Page

gencha
Junior Member

24 Posts

Posted - Feb 02 2009 :  05:30:35 AM  Show Profile  Reply with Quote
So, I took that code and placed it into a new default Win32 Console Application and modified it so that it would compile. And const_iterator is not underlined.
Now I'm just wondering what makes it behave differently in my other project. Is there any way to find out?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Feb 02 2009 :  2:44:58 PM  Show Profile  Reply with Quote
If you copy / paste exactly the same code into a new, empty cpp file in your main solution what happens?

It is possible the problem is triggered by an #include line in your main solution, or something further up one of the files.

zen is the art of being at one with the two'ness
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Feb 02 2009 :  3:08:34 PM  Show Profile  Reply with Quote
It means that your "local" source contains something which confuses the parser. (The settings and stable directories are the same in a newly created test project)

The way to find out the problem is to figure out the difference between your "live" and your "test" project.

Would it be possible to get a copy of your project for testing purposes? Normally this is not possible, but it is worth asking.

If not, you can start by doing some simple tests:
- Is it working in a new file (in the "live" project), which only includes stdafx.h ?
- If yes, your local file should contain something which Visual Assist doesn't like, so try moving the function up to find a location where the underline won't appear.
- If you can find this location we can identify the problematic lines.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Feb 02 2009 :  3:10:33 PM  Show Profile  Reply with Quote
Cross posting, similar questions
Go to Top of Page

gencha
Junior Member

24 Posts

Posted - Feb 02 2009 :  3:51:05 PM  Show Profile  Reply with Quote
In a new file in my live project the const_iterator will be underlined. Including stdafx or not doesn't change that.
The only thing that always makes the difference is adding std:: in front of vector. That will always make VAX underline the iterator. Once it is removed the underline disappears.

If you send me an email I can either set you up with SVN access or zip up a package of the project.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Feb 02 2009 :  6:18:55 PM  Show Profile  Reply with Quote
If the zip file is not to large can you please submit it via the form:

http://www.wholetomato.com/support/contact.asp

including this thread ID or URL in the description, so we can match it up.

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