ReignBough
ReignBough

Reputation: 51

vector in map in map

typedef vector<string>              tdv_Str;
typedef map<string, tdv_Str, CaseI> tdm_StrList; // var name, possible values
typedef map<short, tdm_StrList>     tdm_VarList; // type, var list

*CaseI is string map sorting with case insensitive.

When I check if the key of tdm_VarList (list) is existing or not:

if (list.count(key) == 0)
// ...

then compiled it, I got the following error:

1>c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xtree(1089): error C2220: warning treated as error - no 'object' file generated
1>          c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\map(81) : see reference to class template instantiation 'std::_Tree<_Traits>' being compiled
1>          with
1>          [
1>              _Traits=std::_Tmap_traits<short,tdm_StrList,std::less<short>,std::allocator<std::pair<const short,tdm_StrList>>,false>
1>          ]
1>          Src\APS.cpp(683) : see reference to class template instantiation 'std::map<_Kty,_Ty>' being compiled
1>          with
1>          [
1>              _Kty=short,
1>              _Ty=tdm_StrList
1>          ]
1>c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xtree(1089): warning C4503: 'std::_Tree<_Traits>::_Insert' : decorated name length exceeded, name was truncated
1>          with
1>          [
1>              _Traits=std::_Tmap_traits<short,tdm_StrList,std::less<short>,std::allocator<std::pair<const short,tdm_StrList>>,false>
1>          ]

Upvotes: 0

Views: 113

Answers (1)

Hagen von Eitzen
Hagen von Eitzen

Reputation: 2177

You elevated a warning ("decorated name length exceeded") to an error. In other words, the internal name for the complex type you define has become longer than 4096 characters. The corresponding MS documentation for the warning message explains the problem inmore detail and suggests work-araounds.

Upvotes: 6

Related Questions