It complies ok in msvc++ 6.0 and it also seems to work. But I get so much warnings (about 107), I'm afraid police is coming to arrest me or something.
Any ideas?
thanks.
Last edited by commonbullet; 04-11-2006 at 21:28..
if you want to have the value of a character, you have to use 'a' instead of "A". the latter would give you a pointer to a char array containing an 'A' and a '\0'
Sorry, I didn't get it. I don't mean to get a char value..., I'm pretty stupid with this.
Anyway I found this:
Quote:
When using the STL with MSVC, you may get one or more error messages that look like:
C:\MSOE\stltest\stl2\stl2.cpp(302) : warning C4786: 'std::pair<std::_Tree <int,int, std::set<int,std::less<int>, std::allocator<int>>::_Kfn, std::less<int>, std::allocator<int>>::const_iterator, std::_Tree<int,int, std::set<int,std::less<int>, std::allocator<int>>::_Kfn, std::less<int>, std::allocator<int>>::const_iterator>' : identifier was truncated to '255' characters in the debug information
This message results when MSVC tries to store debug information that includes long names generated by the template expansion process. The problem normally has no significant effect, and the message can be ignored. You may prefer to suppress this warning completely, as it may hide other (more important) error messages. To suppress the warning, add the following line near the top of your program source file:
#pragma warning(disable:4786)
So, maybe it's an old implementation of stl on msvc. I've compiled a similar code with a newer msvc++ (express version) with no warnings. dev-c++ also compiles it with no problems...
Looks to me like msvc++6.0 was trying to keep debug file sizes from getting too large. So wouldn't worry about it. dev-c++ uses the mingw library if I'm not mistaken, and express ed of msvc++ is based on msvc++8 I think.
It's not surprising really that a hash table of strings, using a string as the key, would generate some rather large template names either, and memory use is probably right up there with it (map implementation pending). Is there any other key you could use other than string?