[libcxx-commits] [libcxx] [libc++] Introduce __specialized_algorithms (PR #167295)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 19 07:48:37 PST 2025


================
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+
+// FIXME: This should really be an enum
+namespace _Algorithm {
+  struct __fill_n {};
+} // namespace _Algorithm
+
+template <class>
+struct __single_iterator;
+
+template <class _Alg, class... _Ranges>
+struct __specialized_algorithm {
----------------
ldionne wrote:

This needs a comment explaining what this is all about.

In particular, please mention that `_Ranges` is an "arbitrary" subset of the arguments to the algorithm that is used for dispatching purposes.

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


More information about the libcxx-commits mailing list