From 23f0d94b4f00179c26a6a6b881df67246fd0e921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Thu, 30 Sep 2021 20:27:38 +0200 Subject: [PATCH] Use CATCH_FORWARD in Detail::make_unique --- src/catch2/internal/catch_unique_ptr.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/catch2/internal/catch_unique_ptr.hpp b/src/catch2/internal/catch_unique_ptr.hpp index 237155d8..9c54e92f 100644 --- a/src/catch2/internal/catch_unique_ptr.hpp +++ b/src/catch2/internal/catch_unique_ptr.hpp @@ -11,6 +11,8 @@ #include #include +#include + #if defined(__clang__) && defined(__has_attribute) # if __has_attribute(trivial_abi) # define TRIVIAL_ABI [[clang::trivial_abi]] @@ -116,11 +118,7 @@ namespace Detail { template unique_ptr make_unique(Args&&... args) { - // static_cast does the same thing as std::forward in - // this case, but does not require including big header () - // and compiles faster thanks to not requiring template instantiation - // and overload resolution - return unique_ptr(new T(static_cast(args)...)); + return unique_ptr(new T(CATCH_FORWARD(args)...)); }