Is end() required to be constant in an STL map/set?

前端 未结 10 522
别跟我提以往
别跟我提以往 2021-02-01 15:00

§23.1.2.8 in the standard states that insertion/deletion operations on a set/map will not invalidate any iterators to those objects (except iterators pointing to a deleted eleme

10条回答
  •  天涯浪人
    2021-02-01 15:06

    Assuming that (1) map implemented with red-black tree (2) you use same instance "after a zillion insertions/deletions"- answer "Yes".

    Relative implmentation I can tell that all incarnation of stl I ever know use the tree algorithm.

提交回复
热议问题