Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-09-30 20:27:38 +0200
committerMartin Hořeňovský2021-09-30 20:27:38 +0200
commit23f0d94b4f00179c26a6a6b881df67246fd0e921 (patch)
treeddfd968c78fca20bfcb786d73e07956ff1305ba9 /src
parent77c7e9803eb841f7cec3ec5fa4c239fa091b62c2 (diff)
downloadcatch3-23f0d94b4f00179c26a6a6b881df67246fd0e921.tar.gz
Use CATCH_FORWARD in Detail::make_unique
Diffstat (limited to 'src')
-rw-r--r--src/catch2/internal/catch_unique_ptr.hpp8
1 files 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 <cassert>
#include <type_traits>
+#include <catch2/internal/catch_move_and_forward.hpp>
+
#if defined(__clang__) && defined(__has_attribute)
# if __has_attribute(trivial_abi)
# define TRIVIAL_ABI [[clang::trivial_abi]]
@@ -116,11 +118,7 @@ namespace Detail {
template <typename T, typename... Args>
unique_ptr<T> make_unique(Args&&... args) {
- // static_cast<Args&&> does the same thing as std::forward in
- // this case, but does not require including big header (<utility>)
- // and compiles faster thanks to not requiring template instantiation
- // and overload resolution
- return unique_ptr<T>(new T(static_cast<Args&&>(args)...));
+ return unique_ptr<T>(new T(CATCH_FORWARD(args)...));
}