Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

C++ Language/Std/Stl/CollectionClasses/SortedCollections/Map/SortClass

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

The ordering of items does not matter in a map-literal. What does matter is the "sort-class" template-parameter (the default is std::less<> if omitted). The sort-class determines the actual item-ordering within STL's internal representation (by ordering their keys). When iterators use ++ and --, they follow that sort-class order (not the map-literal's apparent order). Additional information about specifying a sort-class (includes interactive examples)