C++ standard does not enforce any kind of implementation of standard libraries, as long as they perform as specified. Different implementations may use different algorithms. Moreover, the obvious implementation of a map is a binary search tree and does not involve any sorting (I guess you could consider insert() a sorting algorithm.. Anyway, look into binary search trees and you'll see how that works.).