用vecto做三维向量产生warning,不知哪里的问题
我用vector做三维向量 ,然后用typedef 自己命了一个别名。build时产生不明原因的warning 而且之后 只要使用这个别名,就会产生更多的warning。
我自己分析了一下后,把代码简化到了如下,但问题warning依然存在,请大家看看是怎么回事,谢谢。
代码:
#include<vector>
using namespace std;
class A{
public:
A(){};
};
typedef vector<vector<vector<A> > > Space;
void main()
{
Space kkk;
}
//////////////////////////////////
warning 如下:
Compiling...
vectorTest.cpp
E:\Program Files\Microsoft Visual Studio\MyProjects\pqjunior\test\vectorTest.cpp(11) : warning C4786: 'std::reverse_iterator<std::vector<std::vector<A,std::allocator<A> >,std::allocator<std::vector<A,std::allocator<A> > > > const *,std::vector<std::
vector<A,std::allocator<A> >,std::allocator<std::vector<A,std::allocator<A> > > >,std::vector<std::vector<A,std::allocator<A> >,std::allocator<std::vector<A,std::allocator<A> > > > const &,std::vector<std::vector<A,std::allocator<A> >,std::allocator
<std::vector<A,std::allocator<A> > > > const *,int>' : identifier was truncated to '255' characters in the debug information
E:\Program Files\Microsoft Visual Studio\MyProjects\pqjunior\test\vectorTest.cpp(11) : warning C4786: 'std::reverse_iterator<std::vector<std::vector<A,std::allocator<A> >,std::allocator<std::vector<A,std::allocator<A> > > > *,std::vector<std::vector
<A,std::allocator<A> >,std::allocator<std::vector<A,std::allocator<A> > > >,std::vector<std::vector<A,std::allocator<A> >,std::allocator<std::vector<A,std::allocator<A> > > > &,std::vector<std::vector<A,std::allocator<A> >,std::allocator<std::vector
<A,std::allocator<A> > > > *,int>' : identifier was truncated to '255' characters in the debug information
e:\program files\microsoft visual studio\vc98\include\vector(39) : warning C4786: 'std::vector<std::vector<std::vector<A,std::allocator<A> >,std::allocator<std::vector<A,std::allocator<A> > > >,std::allocator<std::vector<std::vector<A,std::allocator
<A> >,std::allocator<std::vector<A,std::allocator<A> > > > > >::vector<std::vector<std::vector<A,std::allocator<A> >,std::allocator<std::vector<A,std::allocator<A> > > >,std::allocator<std::vector<std::vector<A,std::allocator<A> >,std::allocator<std
::vector<A,std::allocator<A> > > > > >' : identifier was truncated to '255' characters in the debug information
e:\program files\microsoft visual studio\vc98\include\vector(60) : warning C4786: 'std::vector<std::vector<std::vector<A,std::allocator<A> >,std::allocator<std::vector<A,std::allocator<A> > > >,std::allocator<std::vector<std::vector<A,std::allocator
<A> >,std::allocator<std::vector<A,std::allocator<A> > > > > >::~vector<std::vector<std::vector<A,std::allocator<A> >,std::allocator<std::vector<A,std::allocator<A> > > >,std::allocator<std::vector<std::vector<A,std::allocator<A> >,std::allocator<st
d::vector<A,std::allocator<A> > > > > >' : identifier was truncated to '255' characters in the debug information
Linking...
test.exe - 0 error(s), 4 warning(s)
注:我用的是vc 所以第一遍build 会报告warning ,但紧接着再按一次build 就不会显示warning 了.
这时候,只要作小改动(比如加一个空格), 再build ,就会出现相同的 warning.