[libcxx-commits] [libcxx] [libc++] Implement `ranges::fold_left_first` and `ranges::fold_left_first_with_iter` (PR #180214)

Connector Switch via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 9 03:15:39 PST 2026


================
@@ -0,0 +1,341 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// <algorithm>
+
+// REQUIRES: std-at-least-c++23
+
+// MSVC warning C4244: 'argument': conversion from 'double' to 'const int', possible loss of data
+// ADDITIONAL_COMPILE_FLAGS(cl-style-warnings): /wd4244
----------------
c8ef wrote:

```c++
auto plus = [](double const x, double const y) { return static_cast<int>(x) + y; };
```

I believe making the change above can elinimate the warning, but I'm not sure if it will still fulfill the testing purpose.

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


More information about the libcxx-commits mailing list