【发布时间】:2011-07-29 23:33:31
【问题描述】:
例如,假设我有一段代码看起来像这样:
mutable std::vector<std::vector<std::vector<std::vector<
std::vector<MyNamespace::MyType> > > > > myFreakingLongVectorThing;
我收到如下警告:
C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\xstring(1665) : warning
C4503: 'std::vector<_Ty>::operator []' : decorated name length exceeded, name was truncated
with
[
_Ty=std::vector<std::vector<std::vector<std::vector<std::vector<MyNamespace::MyType>>>>>
]
有没有什么办法可以重写那个该死的长向量来避免收到警告?我仍然希望数据结构相同,但没有收到警告。我不想禁用警告。可能吗?
注意:这是 Visual Studio 2005
....如果你真的很好奇我为什么要使用如此可怕的数据结构,那是由自动生成的代码引起的。
【问题讨论】:
-
FWIW,Microsoft 增加了 VC++ 2008 中修饰名称的最大长度,主要是因为 Boost 库作者抱怨这个确切的问题。您有机会加入现代世界并使用不到 7 年的编译器吗? ;-]
-
这根本不是 Visual Studio 的错,而是 VC++ 的错。我已经相应地修改了标题和标签。
-
I still want the data structure to be the same, but not get that warning. I don't want to disable the warning. Possible? -
ildjarn:我们正在努力加入现代编译器的现实世界!那么在 Visual Studio 2008 上可以吗?
-
我添加了visualstudio.uservoice.com/forums/121579-visual-studio-2015/…,因为这在 VS2015 中仍然是一个问题
标签: c++ visual-c++ visual-studio-2005 warnings name-decoration