[libcxx-commits] [libcxx] [libcxx] Optimize std::generate for segmented iterators (PR #163006)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 16 19:43:31 PDT 2025


================
@@ -9,19 +9,32 @@
 #ifndef _LIBCPP___ALGORITHM_GENERATE_H
 #define _LIBCPP___ALGORITHM_GENERATE_H
 
+#include <__algorithm/for_each.h>
 #include <__config>
+#include <__utility/forward.h>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
+template <class _Generator>
----------------
frederick-vs-ja wrote:

It seems better to add a TODO issue after fixing the bug of Clang.
```suggestion
// TODO: Turn this into lambda after fixing https://llvm.org/PR145881.
template <class _Generator>
```

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


More information about the libcxx-commits mailing list