Stable Address、Stable Iterator 与对象引用设计 | STL

本章覆盖:stable node address;list;map/set;vector reallocation;unordered reference stability around rehash 的契约;storing pointers into container;external index;ID instead of pointer;ownership;object pool;不要因为需要“引用元素”就无意识制造长期裸指针。

本章知识点

  • stable node address
  • list
  • map/set
  • vector reallocation
  • unordered reference stability around rehash 的契约
  • storing pointers into container
  • external index
  • ID instead of pointer
  • ownership
  • object pool
  • 不要因为需要“引用元素”就无意识制造长期裸指针