[libcxx-commits] [libcxx] 706bd12 - [libc++][NFC] Remove workaround for variadic templates in C++03

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 9 15:05:56 PDT 2021


Author: Louis Dionne
Date: 2021-08-09T18:05:46-04:00
New Revision: 706bd129b35c012860fd381482cfbc066e02639a

URL: https://github.com/llvm/llvm-project/commit/706bd129b35c012860fd381482cfbc066e02639a
DIFF: https://github.com/llvm/llvm-project/commit/706bd129b35c012860fd381482cfbc066e02639a.diff

LOG: [libc++][NFC] Remove workaround for variadic templates in C++03

That's not necessary anymore, since we always build the dylib with
C++11 capabilities nowadays.

Differential Revision: https://reviews.llvm.org/D107772

Added: 
    

Modified: 
    libcxx/src/locale.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index d5ab8fb3b8367..e590d5d99d3a4 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -81,33 +81,11 @@ struct release
     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;
 }
 


        


More information about the libcxx-commits mailing list