[libcxx-commits] [PATCH] D149615: [libc++][PSTL] Implement std::transform
Nikolas Klauser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue May 2 15:26:42 PDT 2023
philnik added inline comments.
================
Comment at: libcxx/test/std/algorithms/alg.modifying.operations/alg.transform/pstl.transform.binary.pass.cpp:30
+
+template <class Iter1, class Iter2, class Iter3>
+struct Test {
----------------
ldionne wrote:
> I think we're missing tests for constraints here and in the other test.
What kind of constraints do you mean?
================
Comment at: libcxx/test/support/type_algorithms.h:56-60
+template <template <class...> class T, class... Args>
+struct partial_instantiation {
+ template <class Other>
+ using type = T<Args..., Other>;
+};
----------------
ldionne wrote:
> I would suggest this instead:
>
> ```
> template <template <class...> class F, class ...T>
> struct partial_instantiation {
> template <class ...Args>
> using apply = F<T..., Args...>;
> };
> ```
>
> This suggests that we're doing partial application of the template `F`. `apply` is often used in these cases so it's kind of idiomatic (e.g. the old MPL and derivatives of it).
`template <class...>` doesn't work when `template <class>` is expected. I first had it the way you have it right now.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149615/new/
https://reviews.llvm.org/D149615
More information about the libcxx-commits
mailing list