During compilation of code :
std::copy(AgentID_To_AgentStruct.begin(),AgentID_To_AgentStruct.end
(),Local_AgentID_To_AgentStruct.begin());
I got error
Error 125 error C2582: 'operator =' function is unavailable in
'std::pair<_Ty1,_Ty2>' D:\Program Files\Microsoft Visual Studio 8\VC
\include\xutility 2266
I am using VC7++.
Thanks
Arkady
sounds like something can't be copied, overload operator= for the
elements of Local_AgentID_To_AgentStruct
Fraser.
>
> I am using VC7++.
I do not think you are using VC7 or VC7.1. The path in the pasted error says
you are using VC8.
--
VH
You really have to provide some more infos. I'm guessing that
AgentID_To_AgentStruct and Local_AgentID_To_AgentStruct are maps of
some sort. This would explain that "std::pair<_Ty1,_Ty2>". However,
the elements of a map are NOT assignable. The key is const which is
why your compiler complained.
If you want to copy the map simply write
map2 = map1;
If you want to add the pairs from one map to the other you can do this
via
#include <iterator>
copy(map1.begin(), map1.end(),
std::inserter(map2,map2.begin()) );
Cheers!
SG
or better yet:
map2.insert(map1.begin(), map1.end());
;-)
Cheers!
SG