[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:06:07 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
ldionne marked an inline comment as done.
Closed by commit rG706bd129b35c: [libc++][NFC] Remove workaround for variadic templates in C++03 (authored by ldionne).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107772/new/
https://reviews.llvm.org/D107772
Files:
libcxx/src/locale.cpp
Index: libcxx/src/locale.cpp
===================================================================
--- libcxx/src/locale.cpp
+++ libcxx/src/locale.cpp
@@ -81,33 +81,11 @@
void operator()(locale::facet* p) {p->__release_shared();}
};
-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)
{
static typename aligned_storage<sizeof(T)>::type buf;
- auto *obj = ::new (&buf) T(a0, a1, a2);
+ auto *obj = ::new (&buf) T(args...);
return *obj;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107772.365296.patch
Type: text/x-patch
Size: 944 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210809/fb0ab1e1/attachment.bin>
More information about the libcxx-commits
mailing list