how does the stl's multimap insert respect orderings?

后端 未结 7 2212
灰色年华
灰色年华 2020-12-03 21:15

I have some data which come with a integer index. I am continuous generating new data which needs to added to the collection of data I have, sorted by that index, at the sa

7条回答
  •  悲&欢浪女
    2020-12-03 21:34

    It seems the new standard (C++11) changed this:

    The order of the key-value pairs whose keys compare equivalent is the order of insertion and does not change.[cppreference]

    I'm hesitating to use it though, as this seems like a detail easily overlooked when modifying the standard library to be C++11 compliant and it's the sort of detail that will silently cause errors if your compiler's library failed to implement properly.

提交回复
热议问题