Advertisement

std::vector<> help

Started by November 08, 2000 07:30 PM
1 comment, last by AbsoluteZero 24 years, 2 months ago
I''m trying to use vectors in my engine, but i''m having some problems... I''d like to use a 2dimensional array of vectors. This is what i''ve got: std::vector< std::vector< int > > vecs; This works fine.... BUT, when i change it to this: std::vector< std::vector< D3DVECTOR > > vecs; I get the following warning: e:\program files\microsoft visual studio\vc98\include\vector(48) : warning C4786: ''??0?$vector@V?$vector@U_D3DVECTOR@@V?$allocator@U_D3DVECTOR@@@std@@@std@@V?$allocator@V?$vector@U_D3DVECTOR@@V?$allocator@U_D3DVECTOR@@@std@@@std@@@2@@std@@QAE@IABV?$ vector@U_D3DVECTOR@@V?$allocator@U_D3DVECTOR@@@std@@@1@ABV?$allocator@V?$vector@U_D3DVECTOR@@V?$allocator@U_D3DVECTOR@@@std@@@std@@@1@@Z'' : identifier was truncated to ''255'' characters in the browser information e:\projects\demo01\cbezierpatch.h(22) : see reference to class template instantiation ''std::vector >,class std::allocator > > >'' being compiled I think I''m getting in over my head here... I pretty much understand whats going on but I don''t see why it gives me the warning when i use a D3DVECTOR instead of plain ints... It seems to be a problem with the class allocator (i think) but a D3DVECTOR isn''t a class, its a struct... is this the problem? Any help would be great, thanks AZ
Do this:
#pragma warning (disable: 4786)

MSVC creates really long names for classes & templates. Almost any std::map will generate this warning. Since your inner vector name wa longer than "int", it flags the warning, too. All the warning''s telling you is that you''ll only get a truncated version of the symbol in debug; your program will still work perfectly.
Advertisement
In C++ a struct is the same as a class. The only difference is that the default "scope"(not sure what it''s called) of things declared in a struct is ''public'', while it is ''private'' in a class.

Both structs and classes can have methods/constructors/destructor/etc...

This topic is closed to new replies.

Advertisement