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ý2025-08-26 12:36:06 +0200
committerMartin Hořeňovský2025-08-26 12:37:52 +0200
commit227af796b4ede6258f9b1ff8b69cd1f03d32f662 (patch)
treecfffe971cbc8d28b4de33c3f87bd590050c679dd /src/catch2/internal
parent33adb4c779feaa3a98bb45ec1ebaf2864bb110b7 (diff)
downloadcatch3-227af796b4ede6258f9b1ff8b69cd1f03d32f662.tar.gz
Move MessageInfos into the run context
Together with the previous change, this means that `ScopedMessage` only needs to keep around a single unsigned int.
Diffstat (limited to 'src/catch2/internal')
-rw-r--r--src/catch2/internal/catch_run_context.cpp4
-rw-r--r--src/catch2/internal/catch_run_context.hpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp
index b6edddb3..3ca15fd0 100644
--- a/src/catch2/internal/catch_run_context.cpp
+++ b/src/catch2/internal/catch_run_context.cpp
@@ -483,8 +483,8 @@ namespace Catch {
m_reporter->benchmarkFailed( error );
}
- void RunContext::pushScopedMessage( MessageInfo const& message ) {
- Detail::g_messages.push_back( message );
+ void RunContext::pushScopedMessage( MessageInfo&& message ) {
+ Detail::g_messages.push_back( CATCH_MOVE(message) );
}
void RunContext::popScopedMessage( unsigned int messageId ) {
diff --git a/src/catch2/internal/catch_run_context.hpp b/src/catch2/internal/catch_run_context.hpp
index 892926a0..1ff9caf6 100644
--- a/src/catch2/internal/catch_run_context.hpp
+++ b/src/catch2/internal/catch_run_context.hpp
@@ -94,7 +94,7 @@ namespace Catch {
void benchmarkEnded( BenchmarkStats<> const& stats ) override;
void benchmarkFailed( StringRef error ) override;
- void pushScopedMessage( MessageInfo const& message ) override;
+ void pushScopedMessage( MessageInfo&& message ) override;
void popScopedMessage( unsigned int messageId ) override;
void emplaceUnscopedMessage( MessageBuilder&& builder ) override;