T O P I C R E V I E W |
gencha |
Posted - Jan 29 2009 : 12:31:35 PM 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. |
11 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Feb 02 2009 : 6:18:55 PM 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. |
gencha |
Posted - Feb 02 2009 : 3:51:05 PM 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. |
accord |
Posted - Feb 02 2009 : 3:10:33 PM Cross posting, similar questions |
accord |
Posted - Feb 02 2009 : 3:08:34 PM 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.
|
feline |
Posted - Feb 02 2009 : 2:44:58 PM 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. |
gencha |
Posted - Feb 02 2009 : 05:30:35 AM 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? |
accord |
Posted - Feb 01 2009 : 1:59:12 PM 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. |
gencha |
Posted - Jan 30 2009 : 9:48:38 PM 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. |
accord |
Posted - Jan 30 2009 : 7:57:15 PM 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 |
gencha |
Posted - Jan 29 2009 : 8:38:41 PM 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. |
accord |
Posted - Jan 29 2009 : 3:41:02 PM 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. |