sorting in std::map where key is a std::string

后端 未结 4 1422
-上瘾入骨i
-上瘾入骨i 2021-02-01 18:20

I have a std::map mymap

Now, if I insert values in the map like:

std::map  mymap;
mymap[\"first\"] = \"hi\";
mymap[\"third\"] = \"         


        
4条回答
  •  清酒与你
    2021-02-01 18:50

    The standard defines:

    The fundamental property of iterators of associative containers is that they iterate through the containers in the non-descending order of keys where non-descending is defined by the comparison that was used to construct them.

提交回复
热议问题