It's probably worth reminding yourself that std::map<K, V>
is actually this:
std::map<K, V, Pred, Alloc>
Since you haven't mentioned Pred
in your map declaration it defaults to std::less<T>
.
Similarly Alloc
defaults to std::allocator<std::pair<const Key, T> >
where std::pair<const Key, T>
is the implied value_type
of your map.
It is the class denoted by Alloc
that determines how and where the values in the map are allocated.
std::allocator<X>
uses ::operator new
and ::operator delete
to allocate and deallocate memory. Unless you have redefined those, memory will be managed by the heap.
You can override this by specifying your own custom type for Alloc
. Doing this successfully however is something of a dark art. You may want to read up on it before you try.
ref: http://en.cppreference.com/w/cpp/concept/Allocator#Allocator_completeness_requirements