Forum Discussion
Altera_Forum
Honored Contributor
13 years agoFailure of STL map "insert()" (VxWorks v6.8). ... MIPS
A_MAP.insert(std::pair<uint16_t, THE_STRUCT_TYPE>(Key, A_STRUCT)) A_MAP[Key] = A_STRUCT; Both methods work on Visual C++ Express 2012. Both methods fail on VxWorks at run-time with Si...
Altera_Forum
Honored Contributor
12 years agoSolved.
It seems that, to which I have elsewhere seen it alluded, the mapped type must, at least in some cases, be a pointer; presumably solving the copy construction prohibition and the unavailability, in pre-C++-2011 installations, of the emplace method. Thus, declaration of the map object would be accomplished as follows: std::map<uint16_t, THE_STRUCT_TYPE*> A_MAP; Insertion procedes as: A_MAP[Key] = &A_STRUCT; Question remaining open: Does v6.9 implement the C++ 2011 Standard, specifically the std::unordered_map container ?