C + + programming fault handling — error: assignment of read only data member ‘STD:: pair Error given when trying to directly modify the key of a pair in the map. The error indicates that the key for pair should be read-only. Therefore, you can delete the pair first, and then insert a matching pair.