Overwrite map with map using <algorithm>?
I would like to do the following, but it doesn't seem to be possible. I am not an STL expert.
typedef std::map<int,int> CMap; CMap m1; m1 = 10; m1 = 11; m1 = 12; CMap m2; m2 = 30; m2 = 31; m2 = 32; std::copy( m1.begin(), m1.end(), m2.begin() );
Is there a way to do this using an algorithm (C ++ 98)? Can this be done with transform () or replace ()? If so, how?
source to share