[libcxx-commits] [PATCH] D97742: [C++23] [P1518R2] Better CTAD behavior for containers with allocators
Arthur O'Dwyer via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Mar 2 06:12:48 PST 2021
Quuxplusone added inline comments.
================
Comment at: libcxx/include/deque:1318
deque(const deque& __c);
- deque(const deque& __c, const allocator_type& __a);
+ deque(const deque& __c, const typename __identity<allocator_type>::type& __a);
----------------
zoecarver wrote:
> I //think// all the compilers we that support support templated type aliases. WDYT about making this `deque(const deque& __c, const __identity_t<allocator_type>& __a);`?
Indeed, I'm 99.9% sure we can use alias templates, because of `_EnableIf`.
But right now libc++ has no `__identity_t` alias. If we were going to add one, I think I'd lobby for it to be like `_Ident<T>`, by analogy with `_EnableIf<B>`, just to keep the boilerplate as short as possible. (Although `_EnableIf` has advantages in minimizing helper template instantiations, whereas this thing would not.)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97742/new/
https://reviews.llvm.org/D97742
More information about the libcxx-commits
mailing list