Persistent Iterators with Value Semantics
Yihe Li, Gregory J. Duck

TL;DR
The paper introduces persistent iterators in C++ that provide safe, versioned access to data structures, combining imperative iterator style with persistent data semantics to prevent invalidation and aliasing issues.
Contribution
It proposes a novel abstraction called persistent iterators, implemented in LibFPP, that offers safe, versioned, iterator-based access to persistent data structures in C++.
Findings
LibFPP provides persistent vectors, maps, sets, and strings.
It eliminates iterator invalidation issues.
Achieves asymptotic complexities comparable to STL implementations.
Abstract
Iterators are a fundamental programming abstraction for traversing and modifying elements in containers in mainstream imperative languages such as C++. Iterators provide a uniform access mechanism that hides low-level implementation details of the underlying data structure. However, iterators over mutable containers suffer from well-known hazards including invalidation, aliasing, data races, and subtle side effects. Immutable data structures, as used in functional programming languages, avoid the pitfalls of mutation but rely on a very different programming model based on recursion and higher-order combinators rather than iteration. However, these combinators are not always well-suited to expressing certain algorithms, and recursion can expose implementation details of the underlying data structure. In this paper, we propose persistent iterators -- a new abstraction that reconciles…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
