Author |
Topic |
|
MrDoomMaster
Tomato Guru
251 Posts |
Posted - Oct 27 2006 : 3:21:39 PM
|
As you know, std::list has a member called 'iterator'. I also have a list class with an 'iterator' class:
XUTIL::xList::iterator iter;
When I create an iterator from my own list class, visual assist lists members for std::list::iterator instead of the ones in my own iterator! It's obviously getting the definitions confused just because they have the same name. Why doesn't VA check namespaces and class names? Can't it be a little smarter about it? Obviously if VA looked at which class 'iterator' is declared in, or what namespace its in, it would see that they are completely different objects.
Is there a work-around for this? Has this problem already been reported? If the problem is known, is there an expected date for the fix? I really hate having to give all of my classes "unique" names just to get the intellisence working correctly. |
|
feline
Whole Tomato Software
United Kingdom
19023 Posts |
Posted - Oct 28 2006 : 12:34:22 PM
|
That is rather unexpected. Normally VA is fairly good at working out what is going on, and looking at the correct class / namespace.
case=3298
For me turning on the two options: VA Options -> Text Editor -> listboxes -> bold non-inherited members VA Options -> Text Editor -> listboxes -> list non-inherited entries first
separates out the local functions and places them at the top of the completion listbox. Alternatively turning on:
VA Options -> Text Editor -> listboxes -> get content from default intellisense
fixes the problem completely, but may have some side effects. Some of the time the IDE's intellisense is more helpful, and other times VAX is more helpful. |
zen is the art of being at one with the two'ness |
Edited by - feline on Oct 28 2006 12:37:12 PM |
|
|
MrDoomMaster
Tomato Guru
251 Posts |
Posted - Oct 29 2006 : 10:43:55 PM
|
Thanks for your reply.
Concerning your first suggestion: I already had them enabled.
The second suggestion: I totally understand the side-effects you're talking about. I notice random things wrong when I enable default intellisense. However, enabling that now is not an option. A few guys I work with have found out that the intellisense in Visual Studio 8 has serious issues. Deleting the DLL responsible for supporting intellisense parsing in VS8 provides a VERY significant performance boost. Projects load instantly. The IDE itself loads instantly. No random crashes. Overall, it's just a great improvement.
Anyway, thanks for the two suggestions. I see that you have listed a case number. Apparently that means this is an issue? Hopefully it's fixed soon! Thanks :) |
|
|
feline
Whole Tomato Software
United Kingdom
19023 Posts |
|
MrDoomMaster
Tomato Guru
251 Posts |
Posted - Oct 30 2006 : 7:16:36 PM
|
File 1 - [list.h] ---------------------------------
namespace blah
{
// Obviously this is a commonly used name, especially
// in STL. Note that it is in a different namespace.
class list
{
public:
void DoSomethingStupid( void )
{
}
};
}
File 2 - [OtherCrap.h] ---------------------------------
namespace blah
{
class OtherCrap
{
public:
void DoAnotherStupidThing( void )
{
list* vec = new vector;
vec->DoSomethingStupid();
}
};
}
Above I have provided a better example of what causes the namespace confusion. I have bolded the lines of code above that are the source of the problem.
When I have two classes in the same namespace, but in different files, accessing one class from the other causes the incorrect members to be listed.
In the example above, I'm creating my own 'vector' class from within the class named 'OtherCrap'. Note that I don't explicitly use "blah::vector" in my vector declaration, since I'm already inside of the namespace 'blah'. When I type vec->, this causes the STL member listing to appear. If I add the explicit blah:: to the front of my vector declaration, THEN and ONLY THEN do I get the correct member listing.
Of course the classes I'm working with have very common names and confuses Visual Assist, even though I'm using namespaces but not explicitly typing the scope resolution operator since I'm already inside of the namespace declaration scope. |
|
|
feline
Whole Tomato Software
United Kingdom
19023 Posts |
Posted - Oct 31 2006 : 11:21:18 AM
|
I have updated the case with this example. Interestingly this looks very similar to an existing bug with duplicate class names in different namespaces (case 734), more so that the original example.
They probably both stem from the same underlying problem. |
zen is the art of being at one with the two'ness |
|
|
MrDoomMaster
Tomato Guru
251 Posts |
Posted - Oct 31 2006 : 11:44:03 AM
|
lol I just made a stupid mistake above:
list* vec = new vector;
this should be:
list* newList = new list;
Anyway, you get the point :) |
|
|
|
Topic |
|