[libcxx-commits] [PATCH] D107772: [libc++][NFC] Remove workaround for variadic templates in C++03
Arthur O'Dwyer via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 9 14:00:49 PDT 2021
Quuxplusone accepted this revision as: Quuxplusone.
Quuxplusone added a comment.
LGTM % whitespace comment, FWIW.
================
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)
{
----------------
As in that other recent review, please prefer libc++ style: `class... Args` and `Args... args`.
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