From ec8598efb17216c0f4c93040ac1b40f97ae01fc7 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Tue, 15 May 2018 20:08:15 +0000 Subject: [PATCH] Use perfect forwarding to deduplicate code in unit test. NFC. llvm-svn: 332388 --- llvm/unittests/Support/CommandLineTest.cpp | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp index 8e5e9ad..ba12c84 100644 --- a/llvm/unittests/Support/CommandLineTest.cpp +++ b/llvm/unittests/Support/CommandLineTest.cpp @@ -54,28 +54,8 @@ class TempEnvVar { template > class StackOption : public Base { public: - // One option... - template - explicit StackOption(const M0t &M0) : Base(M0) {} - - // Two options... - template - StackOption(const M0t &M0, const M1t &M1) : Base(M0, M1) {} - - // Three options... - template - StackOption(const M0t &M0, const M1t &M1, const M2t &M2) : Base(M0, M1, M2) {} - - // Four options... - template - StackOption(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3) - : Base(M0, M1, M2, M3) {} - - // Five options... - template - StackOption(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3, - const M4t &M4) - : Base(M0, M1, M2, M3, M4) {} + template + explicit StackOption(Ts &&... Ms) : Base(std::forward(Ms)...) {} ~StackOption() override { this->removeArgument(); } -- 2.7.4