[libcxx-commits] [libcxx] [libc++][C++26] P2562R1: `constexpr` Stable Sorting (PR #110320)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 15 01:03:49 PDT 2024


================
@@ -80,66 +77,149 @@ test_sort_()
     }
 }
 
-void
-test_larger_sorts(int N, int M)
-{
-    assert(N != 0);
-    assert(M != 0);
-    // create array length N filled with M different numbers
-    int* array = new int[N];
-    int x = 0;
-    for (int i = 0; i < N; ++i)
-    {
-        array[i] = x;
-        if (++x == M)
-            x = 0;
+template <int N, int M>
----------------
philnik777 wrote:

Please don't move the individual test into different functions. If you really want to you can do
```c++
{ // description
  <test code>
}
```
but I'd just keep it as-is if there isn't a reason to change things here.

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


More information about the libcxx-commits mailing list