mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-03 21:49:32 +01:00 
			
		
		
		
	Cleanup SourceLineInfo implementation
Special member functions are now implicit, which should make them both noexcept and constexpr. The `operator<<` has been made into hidden friend as per best practices.
This commit is contained in:
		@@ -50,19 +50,15 @@ namespace Catch {
 | 
			
		||||
            line( _line )
 | 
			
		||||
        {}
 | 
			
		||||
 | 
			
		||||
        SourceLineInfo( SourceLineInfo const& other )            = default;
 | 
			
		||||
        SourceLineInfo& operator = ( SourceLineInfo const& )     = default;
 | 
			
		||||
        SourceLineInfo( SourceLineInfo&& )              noexcept = default;
 | 
			
		||||
        SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default;
 | 
			
		||||
 | 
			
		||||
        bool operator == ( SourceLineInfo const& other ) const noexcept;
 | 
			
		||||
        bool operator < ( SourceLineInfo const& other ) const noexcept;
 | 
			
		||||
 | 
			
		||||
        char const* file;
 | 
			
		||||
        std::size_t line;
 | 
			
		||||
 | 
			
		||||
        friend std::ostream& operator << (std::ostream& os, SourceLineInfo const& info);
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info );
 | 
			
		||||
 | 
			
		||||
    // Bring in operator<< from global namespace into Catch namespace
 | 
			
		||||
    // This is necessary because the overload of operator<< above makes
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user