Use make_unique instead of unique_ptr(new T) in more places

This commit is contained in:
Martin Hořeňovský 2021-05-28 23:43:15 +02:00
parent f9ec34ce01
commit 2ae28fc852
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
3 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@
namespace Catch {
Detail::unique_ptr<ITestInvoker> makeTestInvoker( void(*testAsFunction)() ) {
return Detail::unique_ptr<ITestInvoker>( new TestInvokerAsFunction( testAsFunction ));
return Detail::make_unique<TestInvokerAsFunction>( testAsFunction );
}
AutoReg::AutoReg( Detail::unique_ptr<ITestInvoker> invoker, SourceLineInfo const& lineInfo, StringRef classOrMethod, NameAndTags const& nameAndTags ) noexcept {

View File

@ -42,7 +42,7 @@ Detail::unique_ptr<ITestInvoker> makeTestInvoker( void(*testAsFunction)() );
template<typename C>
Detail::unique_ptr<ITestInvoker> makeTestInvoker( void (C::*testAsMethod)() ) {
return Detail::unique_ptr<ITestInvoker>( new TestInvokerAsMethod<C>(testAsMethod) );
return Detail::make_unique<TestInvokerAsMethod<C>>( testAsMethod );
}
struct NameAndTags {

View File

@ -354,7 +354,7 @@ public:
ConsoleReporter::ConsoleReporter(ReporterConfig const& config)
: StreamingReporterBase(config),
m_tablePrinter(new TablePrinter(config.stream(),
m_tablePrinter(Detail::make_unique<TablePrinter>(config.stream(),
[&config]() -> std::vector<ColumnInfo> {
if (config.fullConfig()->benchmarkNoAnalysis())
{