question about hashmap insert (in a strange way)

using stdext::hash_map in windows as examples, assuming I have

class A with parameter int c;

hash_map<int,A> myMap;

And I read some codes like this which confused me

A* a = NULL;
a = &myMap[1];
a.c = 5;

It seems to me likely be an efficient way to insert an item to hashmap, but how does it work? Where was a created and how was it inserted into the map?

Thanks for the help
map's operator[](int) automatically creates an instance of A on int if int doesn't exist.

But I don't think a.c will work since a is a pointer.
thanks. it should be a->c. typo.
will this be the situation for all stl containers? thanks
I think maps work in this way at least, vector/list/set not. But I never played all containers so far, sorry.
Topic archived. No new replies allowed.