Archived

This topic is now archived and is closed to further replies.

Uncivil

STL map

Recommended Posts

Uncivil    122
What''s wrong with this? #include <string> #include <map> #include <iostream> using namespace std; void main() { map myMap; myMap["test"] = 167; cout << myMap["test"] << endl; } It runs fine but when I compile under VC6 I get 94 warnings C4786. MSDN says it truncated an identifier to 255 characters in the debug information.

Share this post


Link to post
Share on other sites
CpMan    532
The warnings I believe are because in VC6, the debugger doesn''t like types longer than 255 chars. Now, map''s full typename, I think, is greater than 255 chars. Secondly, you need to specify your template args for map.

Map''s typename is

std::map,std::allocator >,int,std::less,std::allocator > >,std::allocatorair,std::allocator > const ,int> > >

I think that''s more than 255...yep...273



Gamedev for learning.
libGDN for putting it all together.
An opensource, cross platform, cross API game development library.

Share this post


Link to post
Share on other sites
Uncivil    122
So I just have to live with the warnings then?

I did specify the template args but don''t know how they didn''t make it into the post. Brain fart I guess.

Share this post


Link to post
Share on other sites
CpMan    532
Heh, no wonder it looks shorter in my post..but yes...it''s 278 chars.



Gamedev for learning.
libGDN for putting it all together.
An opensource, cross platform, cross API game development library.

Share this post


Link to post
Share on other sites
Beer Hunter    712
quote:
Original post by Uncivil
I did specify the template args but don''t know how they didn''t make it into the post.
They''re interpreted as html. Put your code in [source][/source] boxes next time.

Share this post


Link to post
Share on other sites