Author |
Topic |
|
tomc
New Member
2 Posts |
Posted - Nov 18 2004 : 4:29:42 PM
|
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
|
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 |
|
|
jpizzi
Tomato Guru
USA
642 Posts |
Posted - Nov 18 2004 : 11:07:06 PM
|
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 |
|
|
draza
Senior Member
France
48 Posts |
Posted - Nov 19 2004 : 02:21:45 AM
|
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 |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Nov 19 2004 : 12:14:38 PM
|
Did you mention VA in your article? |
|
|
tomc
New Member
2 Posts |
Posted - Nov 19 2004 : 1:00:31 PM
|
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. |
|
|
jpizzi
Tomato Guru
USA
642 Posts |
Posted - Nov 19 2004 : 11:36:27 PM
|
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 |
|
|
draza
Senior Member
France
48 Posts |
Posted - Nov 22 2004 : 02:26:48 AM
|
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 |
|
|
draza
Senior Member
France
48 Posts |
Posted - Nov 22 2004 : 02:29:12 AM
|
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 |
|
|
|
Topic |
|