[libcxx-commits] [libcxx] [libc++] Optimize ranges::{for_each, for_each_n} for segmented iterators (PR #132896)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Mar 25 07:56:28 PDT 2025
================
@@ -10,7 +10,11 @@
#ifndef _LIBCPP___ALGORITHM_FOR_EACH_N_H
#define _LIBCPP___ALGORITHM_FOR_EACH_N_H
+#include <__algorithm/for_each.h>
----------------
philnik777 wrote:
The intent of the granularization was to reduce header size by avoiding code we don't depend on. There is nothing wrong with including more code if you depend on it. That will likely make the average size of headers smaller, since we avoid duplicate implementations that way. FWIW I wouldn't be against merging some of the headers (e.g. `for_each.h` and `for_each_n.h`), but that's a different project.
https://github.com/llvm/llvm-project/pull/132896
More information about the libcxx-commits
mailing list