If you don't want the heap allocated map to leak, and you want that management to be automated, you need some smart pointer type to reference it; map itself doesn't help.
All RAII-driven management of heap resources is tied to some scope somewhere. Anything not tied to scoping has to be treated explicitly: try to calculate the lifetime and explicitly dispose of the resource.
Please explain your example further then, because I don't see it.
> Secondly, doing RAII into and out of a map container is largely a poor idea, and C++ programmers expend energy fighting it.
Again, explain, please. Why is it a "poor idea"? Any links, at least? "Fighting it"... how, exactly?
(It's been a while since I was a professional C++ programmer, but I don't really recognize this characterization.)
> The assignment operation and constructors and destructors of the map element all have lexical scopes somewhere.
Well, yes, but what about the MAP itself? It could easily be heap allocated.
I'm sorry, I just don't see what you're on about.