Skip to content

Iterator Validity

Reini Urban edited this page Jan 4, 2021 · 1 revision

The CTL containers share similar iterator validity rules (eg. with foreach) with that of the STL, CTL iterators are best used with one rule in mind:

  • Elements must not be added, removed, or sorted, to or on a container while iteration is being performed on the container.

Iterators are created as static struct with each I_range call, they are not global. Still they are not protected with a lock or timestamp.

Clone this wiki locally