mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-03 21:49:32 +01:00 
			
		
		
		
	Avoid copying SectionInfo while construction Section
This commit is contained in:
		@@ -10,12 +10,14 @@
 | 
			
		||||
#include <catch2/internal/catch_test_macro_impl.hpp>
 | 
			
		||||
#include <catch2/internal/catch_uncaught_exceptions.hpp>
 | 
			
		||||
 | 
			
		||||
#include <utility>
 | 
			
		||||
 | 
			
		||||
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) {
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user