cppreference.com > C++ Maps > Container constructors & destructors
Container constructors & destructors
Syntax:
  #include <map>
  container();
  container( const container& c );
  ~container();

Every map has a default constructor, copy constructor, and destructor.

The default constructor takes no arguments, creates a new instance of that map, and runs in constant time. The default copy constructor runs in linear time and can be used to create a new map that is a copy of the given map c.

The default destructor is called when the map should be destroyed.

For example, the following code creates a pointer to a vector of integers and then uses the default map constructor to allocate a memory for a new vector:

 vector<int>* v;
 v = new vector<int>();