You are wrong about the internals of std::map
– it uses a data structure with O(log n)
insertion, query and delete times. IIRC, it’s a red-black tree. To answer your question, the objects stored are of type map<int,int>::value_type
which is std::pair<const int, int>
. Here’s the ref.
solved data type of a and b in map