[libcxx-commits] [PATCH] D126283: [libc++] Implement ranges::replace{, _if}

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 7 01:26:27 PDT 2022


philnik added inline comments.


================
Comment at: libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges.replace.pass.cpp:43
+  // simple test
+  test<Iter, Sent, 4>({1, 2, 3, 4}, 2, 23, {1, 23, 3, 4});
+  // no match
----------------
var-const wrote:
> Optional: consider adding comments to imitate named arguments, something like:
> ```
> test<Iter, Sent, 4>(/*input=*/{1, 2, 3, 4}, /*old=*/2, /*new=*/23, /*expected=*/{1, 23, 3, 4});
> ```
I'm using a struct with designated initializers. WDYT?


================
Comment at: libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/ranges.replace.pass.cpp:45
+  // no match
+  test<Iter, Sent, 4>({1, 2, 3, 4}, 5, 23, {1, 2, 3, 4});
+  // all match
----------------
var-const wrote:
> Can this argument be deduced? (in all cases except for `0`, I guess)
I tried it and couldn't get it to work.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126283/new/

https://reviews.llvm.org/D126283



More information about the libcxx-commits mailing list