[libcxx-commits] [PATCH] D135292: [libc++][format] Improves CTAD.
Mark de Wever via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Oct 11 10:38:13 PDT 2022
Mordante marked an inline comment as done.
Mordante added inline comments.
================
Comment at: libcxx/include/__config:1206-1208
+# define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) \
+ template <class _Tag = void> \
+ _ClassName(typename _Tag::__allow_ctad)->_ClassName<_Tag>
----------------
ldionne wrote:
> ldionne wrote:
> > Can we instead try this?
> >
> > ```
> > #define _LIBCPP_CTAD_SUPPORTED_FOR_TYPE(_ClassName) \
> > template <class ..._Tag> \
> > _ClassName(typename _Tag::__allow_ctad...) -> _ClassName<_Tag...>;
> > ```
> >
> > Would that allow handling class templates that take any number of arguments?
> In a follow-up patch, I think we could consider also renaming this macro to `_LIBCPP_CTAD_INTENDED_TO_WORK`? We can bikeshed on that but I think we can find something better than `_LIBCPP_CTAD_SUPPORTED_FOR_TYPE`.
I tried this locally and it works, let's see what the CI thinks.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135292/new/
https://reviews.llvm.org/D135292
More information about the libcxx-commits
mailing list