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
 Visual Assist won't parse iterators correctly
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

zlatnik
New Member

5 Posts

Posted - Mar 14 2005 :  4:02:16 PM  Show Profile
It seems that when I try to use iterators, Visual Assist treats the iterator like a vector, giving me vector methods instead of the underlying data type.

Example:

for (std::vector<SPM>::iterator i = dLines.first; i != dLines.second; i++)
{
(*i)->

The dropdown list at the end of the arrow should be methods of type SPM. I know it knows what SPM's methods are, that is sure. Instead it gives me vector methods.

Is this a bug? I have not modified the included library list for Visual Studio 2003 in Visual Assist except I have added libraries to parse boost and ObjectARX libraries.

Any suggestions?

Thank you,
Sean

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Mar 14 2005 :  5:48:43 PM  Show Profile
i have certainly used (*it). in my code with various collection classes and had VAX produce the correct suggestions.

using .NET 2003 and VAX 1297 the test code:


    std::vector<QString> places;
    places.push_back("florida");
    places.push_back("mars");
    std::vector<QString>::iterator it;
    int	nTotalLength = 0;
    for(it = places.begin(); it != places.end(); ++it) {
        nTotalLength += (*it).length();
    }


compiles just fine. i have used QString since it is a class i am familiar with. when i use:

(*it).|

i get a listbox giving the members of the QString class. when i use:

(*it)->|

i get a listbox showing a different set of members, at a guess std::vector

are you sure you should be doing (*it)-> ?

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

zlatnik
New Member

5 Posts

Posted - Mar 14 2005 :  7:02:02 PM  Show Profile
I am sure. SPM stands for "boost::shared_ptr<MyLine>", and is thus a pointer.

It doesn't matter though- I have tried dereferencing an iterator for std::vector<AcGePoint2d>, and all I got were vector options.

What I found is that if I turn on Microsoft's intellisense, I get what I want. Personally, I'd rather just have Visual Assist on, but if I can't do that then I guess this solution is okay.

I checked, and we are using the same version of Visual Assist.
Perhaps you have intellisense on as well? Or is there some special file I need to include to get Visual Assist to recognize std::vector<AnyType>::iterator? I tried #include <iterator>, but that didn't seem to help. Or what else can I do to get this to work?

Thanks for your help,
Sean
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Mar 20 2005 :  3:28:47 PM  Show Profile
unfortunately there are known problems with VAX and template code. basically the VAX parser is not sufficiently in depth to fully understand all template code.

it turns out that i did have intellisense turned on. i am endlessly changing the settings on this machine as i try to reproduce bug reports on the forum *shrug*

case=201

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