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

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal
diff options
context:
space:
mode:
authorMartin Hořeňovský2022-04-12 21:22:43 +0200
committerMartin Hořeňovský2022-04-13 15:00:50 +0200
commit79d1e8238135427a6780a6db2cdb8b9be0b7f086 (patch)
tree13b7a82bbad094af77171b2807b5d9241acc1721 /src/catch2/internal
parent4f09f1120ba0a28f218a00821a8347a443042ecb (diff)
downloadcatch3-79d1e8238135427a6780a6db2cdb8b9be0b7f086.tar.gz
Store IStream instance owning ptrs in reporter instances
This ended up being a surprisingly large refactoring, motivated by removing a `const_cast` from `Config`'s handling of reporter streams, forced by previous commit.
Diffstat (limited to 'src/catch2/internal')
-rw-r--r--src/catch2/internal/catch_reporter_registry.cpp4
-rw-r--r--src/catch2/internal/catch_reporter_registry.hpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/catch2/internal/catch_reporter_registry.cpp b/src/catch2/internal/catch_reporter_registry.cpp
index 56982e27..c4aef822 100644
--- a/src/catch2/internal/catch_reporter_registry.cpp
+++ b/src/catch2/internal/catch_reporter_registry.cpp
@@ -37,11 +37,11 @@ namespace Catch {
ReporterRegistry::~ReporterRegistry() = default;
- IEventListenerPtr ReporterRegistry::create( std::string const& name, ReporterConfig const& config ) const {
+ IEventListenerPtr ReporterRegistry::create( std::string const& name, ReporterConfig&& config ) const {
auto it = m_factories.find( name );
if( it == m_factories.end() )
return nullptr;
- return it->second->create( config );
+ return it->second->create( CATCH_MOVE(config) );
}
void ReporterRegistry::registerReporter( std::string const& name, IReporterFactoryPtr factory ) {
diff --git a/src/catch2/internal/catch_reporter_registry.hpp b/src/catch2/internal/catch_reporter_registry.hpp
index 3466bfd8..b0864265 100644
--- a/src/catch2/internal/catch_reporter_registry.hpp
+++ b/src/catch2/internal/catch_reporter_registry.hpp
@@ -21,7 +21,7 @@ namespace Catch {
ReporterRegistry();
~ReporterRegistry() override; // = default, out of line to allow fwd decl
- IEventListenerPtr create( std::string const& name, ReporterConfig const& config ) const override;
+ IEventListenerPtr create( std::string const& name, ReporterConfig&& config ) const override;
void registerReporter( std::string const& name, IReporterFactoryPtr factory );
void registerListener( Detail::unique_ptr<EventListenerFactory> factory );