std :: map operator[]
returns a reference to the map element identified by 100 (key), which is then overwritten by the pair returned by std :: make_pair (10,10).
I would suggest:
map.insert( std::make_pair( 100, std::make_pair(10,10) ) );
Inserting a call has the advantage that access to the card occurs only once.
Jens luedicke
source share