[libcxx-commits] [libcxx] [libc++][ranges] optimize the performance of `ranges::starts_with` (PR #84570)

Xiaoyang Liu via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 18 02:12:55 PDT 2024


================
@@ -42,22 +46,44 @@ struct __fn {
             class _Proj1 = identity,
             class _Proj2 = identity>
     requires indirectly_comparable<_Iter1, _Iter2, _Pred, _Proj1, _Proj2>
-  _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(
+  _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI static constexpr bool operator()(
----------------
xiaoyang-sde wrote:

Thank you for the feedback! Should we consider creating a pull request to make the operator() static for all C++23 ranges algorithms? It appears that some, like starts_with and ends_with, still define operator() as a member function.

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


More information about the libcxx-commits mailing list