If I have a std::map with default allocator that initialises to no element, will memory be allocated when it is defined to provide some capacity? Is there a way I can prevent the memory allocation until the first time an insertion is performed? I would like this behaviour because I need to frequently create a map, but it is often not used at all and thus no element is inserted. I would like to pay the cost of memory allocation only when an element is inserted.
i.e.
std::map<string, double> foo{}; // Is there memory allocation here?