[libcxx-commits] [libcxx] [libc++] Introduce __specialized_algorithms (PR #167295)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Nov 25 04:44:23 PST 2025
================
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___ALGORITHM_SPECIALIZED_ALGORITHMS_H
+#define _LIBCPP___ALGORITHM_SPECIALIZED_ALGORITHMS_H
+
+#include <__config>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+namespace _Algorithm {
+ struct __fill_n {};
+} // namespace _Algorithm
+
+template <class>
+struct __single_iterator;
+
+// This struct allows specializing algorithms for specific arguments. This is useful when we know a more efficient
+// algorithm implementation for e.g. library-defined iterators. _Alg is one of tags defined inside the _Algorithm
+// namespace above. _Ranges is an essentially arbitrary subset of the arguments to the algorithm that are used for
----------------
philnik777 wrote:
There is already an `an` before `essentially`. Not sure if you mean the word order is incorrect, but the current suggestion definitely is.
https://github.com/llvm/llvm-project/pull/167295
More information about the libcxx-commits
mailing list