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
 nested templates not parser correctly
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

tomc
New Member

2 Posts

Posted - Nov 18 2004 :  4:29:42 PM  Show Profile
Nested templates are not parsed correctly. This seems to be due to the need to double up the >> characters. Here is an example:

typedef std::map<int, std::pair<int, int>>> NestedMap;

NestedMap is not recognized.

FYI: the <> characters really are balanced.

Using Visual Studio 6.0

VA_X.dll file version 10.0.1246.0
Licensed to:
VA X:
VAOpsWin.dll version 1.0.0.44
MSDev.exe version 6.0.9782.2
Devshl.dll version 6.0.9782.0
Devedit.pkg version 6.0.9782.0
Font: Courier 13(Pixels)
Comctl32.dll version 5.82.2900.2180
WindowsNT 5.1 Build 2600 Service Pack 2
2 processors

Platform: Win32 (x86)
Stable Includes:
C:\\Program Files\\Microsoft SDK\\include;
C:\\Program Files\\Microsoft Visual Studio\\VC98\\INCLUDE;
C:\\Program Files\\Microsoft Visual Studio\\VC98\\MFC\\INCLUDE;
C:\\Program Files\\Microsoft Visual Studio\\VC98\\ATL\\INCLUDE;

Library Includes:
C:\\Program Files\\Microsoft Visual Studio\\VC98\\MFC\\SRC;
C:\\Program Files\\Microsoft Visual Studio\\VC98\\MFC\\INCLUDE;
C:\\Program Files\\Microsoft Visual Studio\\VC98\\ATL\\INCLUDE;
C:\\Program Files\\Microsoft Visual Studio\\VC98\\CRT\\SRC;

Other Includes:

support
Whole Tomato Software

5566 Posts

Posted - Nov 18 2004 :  5:13:47 PM  Show Profile
Pretty much a known problem for users hanging around our forums.

VA X cannot parse some forms of nested templates.

If you think the default Intellisense generated better content in listboxes for your project, you might try enabling "Get content from default Intellisense" in our options dialog.

case=201
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Nov 18 2004 :  11:07:06 PM  Show Profile
Unless there is something omitted in your example, the <> characters are NOT balanced.

When nesting templates, the closing > need to have a space between them. Your example (with what appears to be an extraneous closing angle bracket) becomes:
typedef std::map<int, std::pair<int, int> > > NestedMap
Does that help VA's parsing?

That being said, VA does have problems with templates at times (as support has said).

Joe Pizzi
Go to Top of Page

draza
Senior Member

France
48 Posts

Posted - Nov 19 2004 :  02:21:45 AM  Show Profile
quote:
Originally posted by jpizzi

Unless there is something omitted in your example, the <> characters are NOT balanced.

When nesting templates, the closing > need to have a space between them. Your example (with what appears to be an extraneous closing angle bracket) becomes:
typedef std::map<int, std::pair<int, int> > > NestedMap
Does that help VA's parsing?

That being said, VA does have problems with templates at times (as support has said).



Just a side note - expression like
typedef std::map<int, std::pair<int, int>> NestedMap
should not compile at all (note that I fixed (deleted) the extra ">" that you point out as well) thus it does not matter if VA recognizes it or not ;) Those wanting to know why - there is an operator ">>" that would be hard to disambiguate from this case so the standard enforces the usage with spaces, as shown in the jpizzi's example above.
That said, VA is actually quite good in recognizing complicated templates in general. I have recently published an article in C++ Users Journal where I implemented certain technique from C# using very complicated C++ templates + using some complicated boost code relying on a lot templates and most if not all was correctly color coded.

This problem when solved will be simple
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Nov 19 2004 :  12:14:38 PM  Show Profile
Did you mention VA in your article?
Go to Top of Page

tomc
New Member

2 Posts

Posted - Nov 19 2004 :  1:00:31 PM  Show Profile
Although I cannot find any formal declaration of why this works with VS6, the extra > (what appears to unbalance the <> characters) is accepted by VS6 (this is why I state that they are 'balanced'). For some reason, this is something that I have seen used in much of the code I have looked at. As you point out, the 'correct' solution is to put a space between the > > characters. However, given the fact that VS6 accepts this syntax, so should VA.

In general, I still think this is a great product.
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Nov 19 2004 :  11:36:27 PM  Show Profile
quote:
I have recently published an article in C++ Users Journal where I implemented certain technique...
I'll bet you mean "Asynchronous Delegates & C++" in the November 2004 issue. I just read that!!

(Support: No, he didn't mention VA. But, then again, other than just putting a brazen plug in the article, it wouldn't have fit in.)

Joe Pizzi
Go to Top of Page

draza
Senior Member

France
48 Posts

Posted - Nov 22 2004 :  02:26:48 AM  Show Profile
quote:
Originally posted by jpizzi

quote:
I have recently published an article in C++ Users Journal where I implemented certain technique...
I'll bet you mean "Asynchronous Delegates & C++" in the November 2004 issue. I just read that!!

(Support: No, he didn't mention VA. But, then again, other than just putting a brazen plug in the article, it wouldn't have fit in.)



Yes, that's the one

Anyway, I did mention VA (very positively) in one of my blog posts

This problem when solved will be simple
Go to Top of Page

draza
Senior Member

France
48 Posts

Posted - Nov 22 2004 :  02:29:12 AM  Show Profile
quote:
Originally posted by support

Did you mention VA in your article?



No, it did not fit in - they would have considered it advertising :) But if I promise to promote you wherever I can, will you fix those few small coloring C# bugs that remain in 1287?

This problem when solved will be simple
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