diff --git a/src/catch2/internal/catch_section.cpp b/src/catch2/internal/catch_section.cpp index 52361584..9db6ca9f 100644 --- a/src/catch2/internal/catch_section.cpp +++ b/src/catch2/internal/catch_section.cpp @@ -10,12 +10,14 @@ #include #include +#include + namespace Catch { - Section::Section( SectionInfo const& info ) - : m_info( info ), - m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) ) - { + Section::Section( SectionInfo&& info ): + m_info( std::move( info ) ), + m_sectionIncluded( + getResultCapture().sectionStarted( m_info, m_assertions ) ) { // Non-"included" sections will not use the timing information // anyway, so don't bother with the potential syscall. if (m_sectionIncluded) { diff --git a/src/catch2/internal/catch_section.hpp b/src/catch2/internal/catch_section.hpp index 997e7069..bdaf54af 100644 --- a/src/catch2/internal/catch_section.hpp +++ b/src/catch2/internal/catch_section.hpp @@ -19,7 +19,7 @@ namespace Catch { class Section : NonCopyable { public: - Section( SectionInfo const& info ); + Section( SectionInfo&& info ); ~Section(); // This indicates whether the section should be executed or not