A
Allen
I want to reset all the values in the map, but the codes cannot run
correctly.
typedef std::map<void*, int*> v2pmap;
v2pmap m;
....
m[v1] = p1;
m[v2] = p2;
m[v3] = p3;
....
v2pmap::iterator itr = m.begin();
while (itr != m.end())
{
void* vptr = itr->first;
m[vptr] = NULL;
}
I use v2pmap in a embedded system project. m is initialized with known
keys which mapping values change. I donot want to clear m and insert
key value mapping entries again and again.
So how reset the values to be NULL?
Thank you.
Allen
correctly.
typedef std::map<void*, int*> v2pmap;
v2pmap m;
....
m[v1] = p1;
m[v2] = p2;
m[v3] = p3;
....
v2pmap::iterator itr = m.begin();
while (itr != m.end())
{
void* vptr = itr->first;
m[vptr] = NULL;
}
I use v2pmap in a embedded system project. m is initialized with known
keys which mapping values change. I donot want to clear m and insert
key value mapping entries again and again.
So how reset the values to be NULL?
Thank you.
Allen