[libcxx-commits] [libcxx] [libc++] Optimize ranges::for_each for iterating over __trees (PR #164405)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Dec 1 08:23:06 PST 2025


================
@@ -717,6 +718,63 @@ private:
   friend class __tree_const_iterator;
 };
 
+template <class _Reference, class _Break, class _NodePtr, class _Func, class _Proj>
+_LIBCPP_HIDE_FROM_ABI bool __tree_iterate_from_root(_Break __break, _NodePtr __root, _Func& __func, _Proj& __proj) {
----------------
ldionne wrote:

Let's actually document what this function does: It iterates over the whole tree in "left-to-right" order (i.e. the same order that iterators represent), until `__break` tells it to stop.

https://github.com/llvm/llvm-project/pull/164405


More information about the libcxx-commits mailing list