[libcxx-commits] [PATCH] D149615: [libc++][PSTL] Implement std::transform
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed May 3 13:53:47 PDT 2023
ldionne added inline comments.
================
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>;
+};
----------------
philnik wrote:
> 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.
Ahhhh yeah I remember that issue. I still think `apply` would be a naming improvement though.
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