[libcxx-commits] [PATCH] D107772: [libc++][NFC] Remove workaround for variadic templates in C++03
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 9 15:05:26 PDT 2021
ldionne accepted this revision.
ldionne marked an inline comment as done.
ldionne added a comment.
This revision is now accepted and ready to land.
The windows job failed due to "no space left on device", so I'll assume this passed.
================
Comment at: libcxx/src/locale.cpp:84-85
-template <class T, class A0>
-inline
-T&
-make(A0 a0)
-{
- static typename aligned_storage<sizeof(T)>::type buf;
- auto *obj = ::new (&buf) T(a0);
- return *obj;
-}
-
-template <class T, class A0, class A1>
-inline
-T&
-make(A0 a0, A1 a1)
-{
- static typename aligned_storage<sizeof(T)>::type buf;
- ::new (&buf) T(a0, a1);
- return *reinterpret_cast<T*>(&buf);
-}
-
-template <class T, class A0, class A1, class A2>
-inline
-T&
-make(A0 a0, A1 a1, A2 a2)
+template <class T, class ...Args>
+T& make(Args ...args)
{
----------------
Quuxplusone wrote:
> As in that other recent review, please prefer libc++ style: `class... Args` and `Args... args`.
There's no "libc++" style in this case. I get 652 hits for `class ...`, and 940 hits for `class...`, so there's no clearly consistent approach here. If you can explain to me why `class...` is better, I'll change it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107772/new/
https://reviews.llvm.org/D107772
More information about the libcxx-commits
mailing list