Archived

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

STL Map

This topic is 5154 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In examples std::map is used like
map<class one, class two>
, but for some reason, whenever I use it like that, I get compiler errors. Anyone know what I'm doing wrong? Example
#include <iostream>
#include <map>

typedef std::map<int, bool> newMap;

int main()
{
	newMap TheMap;	
	return 0;
}
C:\Program Files\Microsoft Visual Studio\MyProjects\Testing\Main.cpp(50) : warning C4786: 'std::reverse_bidirectional_iteratorair,std::map,std::allocator >::_Kfn,std::less,std ::allocator >::iterator,std:air,std:air &,std:air *,int>' : identifier was truncated to '255' characters in the debug information C:\Program Files\Microsoft Visual Studio\MyProjects\Testing\Main.cpp(50) : warning C4786: 'std::reverse_bidirectional_iteratorair,std::map,std::allocator >::_Kfn,std::less,std ::allocator >::const_iterator,std:air,std:air const &,std:air const *,int>' : identifier was truncated to '255' characters in the debug information C:\Program Files\Microsoft Visual Studio\MyProjects\Testing\Main.cpp(50) : warning C4786: 'std:airair,std::map,std::allocator >::_Kfn,std::less,std::allocator >::itera tor,std::_Treeair,std::map,std::allocator >::_Kfn,std::less,std::allocator >::iterator>' : identifier was truncated to '255' characters in the debug information C:\Program Files\Microsoft Visual Studio\MyProjects\Testing\Main.cpp(50) : warning C4786: 'std:airair,std::map,std::allocator >::_Kfn,std::less,std::allocator >::const _iterator,std::_Treeair,std::map,std::allocator >::_Kfn,std::less,std::allocator >::const_iterator>' : identifier was truncated to '255' characters in the debug information c:\program files\microsoft visual studio\vc98\include\xtree(182) : warning C4786: 'std::_Treeair,std::map,std::allocator >::_Kfn,std::less,std::allocator >::~_Treeair,std::map,std::allocator >::_Kfn,std::less,std::allocator >' : identifier was truncated to '255' characters in the debug information c:\program files\microsoft visual studio\vc98\include\xtree(162) : warning C4786: 'std::_Treeair,std::map,std::allocator >::_Kfn,std::less,std::allocator >::_Treeair,std::map,std::allocator >::_Kfn,std::less,std::allocator >' : identifier was truncated to '255' characters in the debug information [edited by - PumpkinPieman on November 7, 2003 1:00:53 AM]

Share this post


Link to post
Share on other sites
Those are warnings, not errors. You can safely ignore these particular ones; they''re a limitation of MSVC 6.0. To hide them, add this line:

#pragma warning(disable : 4786)


"Sneftel is correct, if rather vulgar." --Flarelocke

Share this post


Link to post
Share on other sites
c:\program files\microsoft visual studio\vc98\include\xtree(182) : warning C4786: ''std::_Tree<int,std::pair<int const ,bool>,std::map<int,bool,std::less<int>,std::allocator<bool> >::_Kfn,std::less<int>,std::allocator<bool> >::~_Tree<int,std::pair<in
t const ,bool>,std::map<int,bool,std::less<int>,std::allocator<bool> >::_Kfn,std::less<int>,std::allocator<bool> >'' : identifier was truncated to ''255'' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\xtree(162) : warning C4786: ''std::_Tree<int,std::pair<int const ,bool>,std::map<int,bool,std::less<int>,std::allocator<bool> >::_Kfn,std::less<int>,std::allocator<bool> >::_Tree<int,std::pair<int
const ,bool>,std::map<int,bool,std::less<int>,std::allocator<bool> >::_Kfn,std::less<int>,std::allocator<bool> >'' : identifier was truncated to ''255'' characters in the debug information
Okay, That worked, but it still generated 2 warnings.

Share this post


Link to post
Share on other sites
Make sure you put that line before including any headers. Unfortunately, I seem to recall a bug in 6.0 that prevented it from hiding all of them under some circumstances, so you may just have to deal with it. (other than cluttering your build results, there''s no problem with it... your program still gets built if there are no errors.)


"Sneftel is correct, if rather vulgar." --Flarelocke

Share this post


Link to post
Share on other sites