Author |
Topic |
|
yuri
Ketchup Master
USA
85 Posts |
Posted - May 12 2004 : 11:19:59 AM
|
I know this has been talked about. After some searches I did find some answers but given this *really simple* example, why doesn't VAX recognize the type?
#define Vector(value) std::vector<value > typedef Vector(int) IntVec;
void doStuff() { IntVec v; v.push_back(1); }
When I type "v." VAX doesn't know what type v is. If I make the typedef the true form, typedef std::vector<int> IntVector, it recognizes it just fine. Is there any reason this doesn't work?
using build 1233 on .NET 2k3 |
|
support
Whole Tomato Software
5566 Posts |
Posted - May 12 2004 : 11:53:09 PM
|
We tried your example. It works fine. We get a listbox, tooltip for v appears okay and HCB updates correctly.
Did you try your example in a separate file?
For a shot in the dark, try Rebuild on the Performance node of our options dialog. Restart your IDE. |
Whole Tomato Software, Inc. |
|
|
yuri
Ketchup Master
USA
85 Posts |
Posted - May 13 2004 : 07:40:03 AM
|
Yes, the #define and typedef are in a separate file from the source code using it. I did try rebuilding and restarting the IDE. I will see if putting the #define and typedef in the file using it makes a difference. |
|
|
yuri
Ketchup Master
USA
85 Posts |
Posted - May 13 2004 : 08:25:29 AM
|
Yes, the example was a bad one because when I tested a map and vector it worked. But the following example still fails. I checked and rechecked. The String class is one of my own but you get the point.
Ok, I have something like the following all in a seperate file:
#if defined(GCC_3_1) # define HashMap ::__gnu_cxx::hash_map #elif defined(COMPILER_MSVC) # define HashMap ::stdext::hash_map #else # define HashMap ::std::hash_map #endif
#define StringHashMap(value) HashMap<String, value, _StringHash>
Then in a separate file I use it:
typedef StringHashMap(int) StringIntHashMap; void doStuff() { StringIntHaspMap test; test.insert(...); }
When "test." gets typed it doesn't recognize test as a type. I did rewrite the typedef to read, typedef ::stdext::hash_map<String, int, _StringHash> StringIntHashMap, in the source file and it works fine.
Oh wait, I get it. After typing this up I realized what's going on. VAX can't resolve the type because it has no idea what's defined thus HashMap is referring to an unknown.
If, let's say, I have #defined COMPILER_MSVC in a file wouldn't VAX know which HashMap to use? This is probably a question that has been brought up. I will seach again to see. |
|
|
yuri
Ketchup Master
USA
85 Posts |
|
support
Whole Tomato Software
5566 Posts |
Posted - May 16 2004 : 10:58:31 PM
|
Your best option probably is to add a preferred, simple typdef for StringIntHashMap to stdafx.h in the Misc subdirectory of the VA X installation directory. After the change, press Rebuild on our Performance tab and restart your IDE.
http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=1900 |
Whole Tomato Software, Inc. |
|
|
|
Topic |
|